Rustdoc-Json: Don't remove impls for items imported from private modules#100325
Rustdoc-Json: Don't remove impls for items imported from private modules#100325bors merged 1 commit intorust-lang:masterfrom
Conversation
src/librustdoc/passes/stripper.rs
Outdated
There was a problem hiding this comment.
does this need to special-case the JSON backend? are we sure this doesn't break anything for the HTML backend?
There was a problem hiding this comment.
I don't think so, as HTML shouldn't have imports to items that arn't retained at this point, due to the strip-priv-imports pass. It also passes all rustdoc html/ui/gui/js tests, but I'm not sure how comprehensive these are.
There was a problem hiding this comment.
It's mostly testing that something exists. It's hard to confirm in prevision for something that doesn't and shouldn't exist.
There was a problem hiding this comment.
I'd feel more at ease if you added a check for the JSON format. You already have this information in self.is_json_output.
7bbb0d4 to
40fe3b2
Compare
src/librustdoc/passes/stripper.rs
Outdated
There was a problem hiding this comment.
Nitpicking:
| // FIXME: Is it nessessary to check for json output here: See | |
| // FIXME: Is it necessary to check for json output here: See |
Fixes a bug where impl of items that were imported from a private module would be striped Fixes rust-lang#100252 Fixes rust-lang#100242
src/librustdoc/passes/stripper.rs
Outdated
There was a problem hiding this comment.
I didn't know you could do that. :o
There was a problem hiding this comment.
Not on stable yet, but let_chains are dope!
40fe3b2 to
44b489f
Compare
|
Looks good to me, thanks! I'll r+ once CI pass. |
|
@bors r+ |
…uillaumeGomez Rustdoc-Json: Don't remove impls for items imported from private modules After rust-lang#99287, items in private modules may still be in the json output, if a public import accesses them. To reflect this, items that are imported need to be marked as retained in the `Stripper` pass, so their impls arn't removed by `ImplStripper`. [More context on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Populating.20cache.2Eimpls), thanks to @ jyn514 for helping debug this. `@rustbot` modify labels: +A-rustdoc-json +T-rustdoc r? `@GuillaumeGomez` Fixes rust-lang#100252 Fixes rust-lang#100242
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#100031 (improve "try ignoring the field" diagnostic) - rust-lang#100325 (Rustdoc-Json: Don't remove impls for items imported from private modules) - rust-lang#100377 (Replace - with _ in fluent slugs to improve developer workflows) - rust-lang#100458 (Adjust span of fn argument declaration) - rust-lang#100514 (Delay span bug when failing to normalize negative coherence impl subject due to other malformed impls) - rust-lang#100528 (Support 1st group of RISC-V Bitmanip backend target features) - rust-lang#100559 (Parser simplifications) - rust-lang#100568 (Fix STD build for ESP-IDF) - rust-lang#100582 ([rustdoc] Fix handling of stripped enum variant in JSON output format) - rust-lang#100586 (Reland changes replacing num_cpus with available_parallelism ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
After #99287, items in private modules may still be in the json output, if a public import accesses them. To reflect this, items that are imported need to be marked as retained in the
Stripperpass, so their impls arn't removed byImplStripper.More context on zulip, thanks to @ jyn514 for helping debug this.
@rustbot modify labels: +A-rustdoc-json +T-rustdoc
r? @GuillaumeGomez
Fixes #100252
Fixes #100242