Apply doc(cfg) from parent items while collecting trait impls#79349
Apply doc(cfg) from parent items while collecting trait impls#79349bors merged 2 commits intorust-lang:masterfrom
doc(cfg) from parent items while collecting trait impls#79349Conversation
|
(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 🤦 |
|
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 🤷 |
| 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.
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
cleanhierarchy they do not participate in thepropagate_doc_cfgpass, so instead we need to pre-collect all possibledoc(cfg)attributes that will apply to them when cleaning.fixes #79201