diff options
| author | bors <bors@rust-lang.org> | 2021-11-23 03:13:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-23 03:13:26 +0000 |
| commit | 2e055d92e0d527b273d12584bd842f6527e7652c (patch) | |
| tree | c080a888a183d63a7bcfd4d0210e54e89dfcd415 /compiler/rustc_codegen_llvm/src/attributes.rs | |
| parent | 8d0c79d26995a973c6f33c32ffb0c827d78bb213 (diff) | |
| parent | 3c510383c4149411ea23b18a7d0048fc3c5a17cc (diff) | |
| download | rust-2e055d92e0d527b273d12584bd842f6527e7652c.tar.gz rust-2e055d92e0d527b273d12584bd842f6527e7652c.zip | |
Auto merge of #91094 - inquisitivecrystal:rustdoc-top-mod, r=jyn514
Avoid documenting top-level private imports PR #88447 aimed to make rustdoc's `--document-private-items` mode only document imports that are visible outside the importing module. Unfortunately, I inadvertently set things up so that imports at the crate top-level are always documented, regardless of their visibility. This behavior was unintended and is [not desirable](https://github.com/rust-lang/rust/issues/90865#issuecomment-971172649). This PR treats top-level imports as never being visible outside their parent module. In practice, the only way a top-level import can be visible externally is if it's fully public, and there's a seperate check for that. It's worth calling attention to the fact that this change means that `pub(crate)` imports will be visible in lower level modules, but not at the top-level. This is because, at the top level of the crate, `pub(crate)` means the same thing as `pub(self)`. It turned out that there were existing tests checking for the only behavior, which I didn't notice at the time of my previous PR. I have updated them to check for the new behavior and substantially extended them to handle differences between the top-level module and lower level modules. I may have gone overboard, so please tell me if there's anything I should cut. r? `@jyn514` Fixes #90865.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
0 files changed, 0 insertions, 0 deletions
