-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Wrong pub
modifier in each function of trait documentation
#81274
Comments
Yes, this needs the same fix as #77820 (comment) (in particular rust/src/librustdoc/clean/mod.rs Lines 1732 to 1733 in 0e1a302
|
Self-assigning because this is a beta regression. |
Note that this also occurs for the impl's docs. |
Removed |
In nightly, trait methods still rendered as Is there something wrong to Rust release or the bug still exists ? |
Hmm, maybe it was only fixed for items in the local crate. @lzutao do you have time to come up with an MCVE? I expect it's related to cross-crate re-exports. |
Your guess sounds right. With core link (https://doc.rust-lang.org/nightly/core/iter/trait.ExactSizeIterator.html#provided-methods), things are normal. |
I don't think I'll have time to fix this second part soon, so unassigning myself. |
Assigning |
This comment has been minimized.
This comment has been minimized.
I think rust/src/librustdoc/clean/mod.rs Line 1156 in dab3a80
|
rustdoc: Fix visibility of trait and impl items Fixes rust-lang#81274. r? `@jyn514`
Fix backported to 1.50.0 and landed in 1.51.0, closing this. |
Please reopen. The issue is not entirely fixed for cross-crate trait reexport case. |
The cross-crate issue is now on stable. @rustbot label: +regression-from-stable-to-stable -regression-from-stable-to-beta |
@rustbot claim |
The documentation of Iterator trait on 1.49.0 (current stable) doesn't contain
pub
modifier in function declaration of that trait.However, on beta and nightly, there is
pub
modifier.This is wrong because you cannot use
pub
modifier for each method/function in Trait definition.Why is this important? People copy the method/function declaration in the documentation to their code
and see the compiler error:
error[E0449]: unnecessary visibility qualifier
.Meta
rustc --version --verbose
:cc @jyn514 I think this might relate to some changes in visibility around macros ?
The text was updated successfully, but these errors were encountered: