-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Apply doc(cfg)
from parent items while collecting trait impls
#79349
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Looks good to me, thanks! Maybe @jyn514 will want to take a look at the |
Just pushed the test I had written but forgot to commit before 🤦 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but this will conflict with #79312 - do you mind rebasing over that?
Ah, the debug derives. I can just drop that commit, it was just something I used while trying to track down where this needed to go and thought would be useful to leave in for others. |
Because trait impls bypass the standard `clean` hierarchy they do not participate in the `propagate_doc_cfg` pass, so instead we need to pre-collect all possible `doc(cfg)` attributes that will apply to them when cleaning.
@Nemo157 no, the whole thing will conflict - doctree::Impl is being deleted and the code for impls works off of hir::ItemKind now. |
I cherry-picked this change onto that branch, it applied without any conflicts 🤷 |
@@ -435,7 +432,7 @@ crate fn build_impl( | |||
|
|||
debug!("build_impl: impl {:?} for {:?}", trait_.def_id(), for_.def_id()); | |||
|
|||
ret.push(clean::Item::from_def_id_and_parts( | |||
let mut item = clean::Item::from_def_id_and_parts( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to distinguish when things are being overriden by rustdoc (as opposed to what most tools will see).
let mut item = clean::Item::from_def_id_and_parts( | |
let mut what_rustc_thinks = clean::Item::from_def_id_and_parts( |
I guess it doesn't make as much sense here because you used mutability instead of record update syntax ... up to you whether you want to change it.
r=me unless you want to fix the nit. @bors delegate=Nemo157 |
✌️ @Nemo157 can now approve this pull request |
@Nemo157 Triage: what's the current status of this? |
I think we should just land this. @bors r+ |
📌 Commit d93f1d6 has been approved by |
☀️ Test successful - checks-actions |
Because trait impls bypass the standard
clean
hierarchy they do not participate in thepropagate_doc_cfg
pass, so instead we need to pre-collect all possibledoc(cfg)
attributes that will apply to them when cleaning.fixes #79201