diff options
| author | bors <bors@rust-lang.org> | 2024-05-20 13:37:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-20 13:37:35 +0000 |
| commit | 75cb5c51cdb82d971d64576cd356f708e131501f (patch) | |
| tree | adb508ac88c7bc18084d856184cdd312482b1236 /src | |
| parent | 44d679b9021f03a79133021b94e6d23e9b55b3ab (diff) | |
| parent | e45fd0686fe9a4a616bf91bcab4064de80261d57 (diff) | |
Auto merge of #125324 - matthiaskrgr:rollup-5vcgjtq, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #125255 (Make `EvalCtxt` generic over `InferCtxtLike`) - #125283 (Use a single static for all default slice Arcs.) - #125300 (rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`) - #125309 (Fix `tests/debuginfo/strings-and-strs`.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/passes/strip_aliased_non_local.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustdoc/passes/strip_aliased_non_local.rs b/src/librustdoc/passes/strip_aliased_non_local.rs index 848cbd5ed99..ac7d422ec80 100644 --- a/src/librustdoc/passes/strip_aliased_non_local.rs +++ b/src/librustdoc/passes/strip_aliased_non_local.rs @@ -46,8 +46,13 @@ impl<'tcx> DocFolder for NonLocalStripper<'tcx> { // the field and not the one given by the user for the currrent crate. // // FIXME(#125009): Not-local should probably consider same Cargo workspace - if !i.def_id().map_or(true, |did| did.is_local()) { - if i.visibility(self.tcx) != Some(Visibility::Public) || i.is_doc_hidden() { + if let Some(def_id) = i.def_id() + && !def_id.is_local() + { + if i.is_doc_hidden() + // Default to *not* stripping items with inherited visibility. + || i.visibility(self.tcx).map_or(false, |viz| viz != Visibility::Public) + { return Some(strip_item(i)); } } |
