diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-09 13:32:07 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-09 18:08:22 +0100 |
| commit | e8bd4ef1e5e9ccbcbc7501300a69dc799e1cd078 (patch) | |
| tree | 1ea169dd83618ed238d899b0eb71d5eb4375da02 /src | |
| parent | 7c306f6dcd600b1fcc74439c780e8ebef338d84c (diff) | |
| download | rust-e8bd4ef1e5e9ccbcbc7501300a69dc799e1cd078.tar.gz rust-e8bd4ef1e5e9ccbcbc7501300a69dc799e1cd078.zip | |
Don't hide anonymous re-exports but never inline them
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 5bbbff175cf..a96bdbbfe2d 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -223,6 +223,11 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { ) -> bool { debug!("maybe_inline_local res: {:?}", res); + if renamed == Some(kw::Underscore) { + // We never inline `_` reexports. + return false; + } + if self.cx.output_format.is_json() { return false; } @@ -329,8 +334,8 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { self.visit_foreign_item_inner(item, None); } } - // If we're inlining, skip private items or item reexported as "_". - _ if self.inlining && (!is_pub || renamed == Some(kw::Underscore)) => {} + // If we're inlining, skip private items. + _ if self.inlining && !is_pub => {} hir::ItemKind::GlobalAsm(..) => {} hir::ItemKind::Use(_, hir::UseKind::ListStem) => {} hir::ItemKind::Use(path, kind) => { |
