Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document more crate features #1411

Merged
merged 3 commits into from
Mar 18, 2024
Merged

document more crate features #1411

merged 3 commits into from
Mar 18, 2024

Conversation

TheIronBorn
Copy link
Contributor

This should hopefully avoid issues like #1410. I tried getting doc_cfg to work again but didn't have much luck so I defaulted to doc comments

@newpavlov
Copy link
Member

It's better to switch to the doc_auto_cfg feature instead. It will automatically add this information to all items.

@TheIronBorn
Copy link
Contributor Author

I looked into that but the difference between the two doesn't seem well documented and it didn't seem to do anything that doc_cfg didn't. So I didn't think it worth complicating this PR. Also rust-lang/rust#90497 means we would still need to review the behavior

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a final note, do you want to fix #1327 here? The comment in Cargo.toml should probably use this command:

RUSTDOCFLAGS="--cfg doc_cfg -Zunstable-options --generate-link-to-definition" cargo +nightly doc --all --all-features --no-deps --open

src/distributions/integer.rs Outdated Show resolved Hide resolved
src/distributions/uniform.rs Outdated Show resolved Hide resolved
Comment on lines 676 to 678
#[cfg(feature = "alloc")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
impl<'a, S: Index<usize, Output = T> + ?Sized + 'a, T: 'a> Iterator for SliceChooseIter<'a, S, T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't show up anywhere because SliceChooseIter is already cfg(feature = "alloc") and Iterator is not a local trait.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth leaving it here in case rustdoc picks it up later?

@TheIronBorn
Copy link
Contributor Author

I'll add that to the toml sure

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Don't care much about the redundant docs. Thanks!

@dhardy dhardy merged commit 769bcb6 into master Mar 18, 2024
12 checks passed
@newpavlov newpavlov deleted the patch-3 branch May 22, 2024 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants