diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-06-19 21:17:57 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-06-20 18:09:50 +0200 |
| commit | db95734b9d41e00c17bb934b96ffd8cb660a2248 (patch) | |
| tree | d9d44021899e2f567e42323646db78bce36f8919 /src/librustdoc/visit_ast.rs | |
| parent | bc20a8e01a6c480c98f0155252b3cce57d338096 (diff) | |
| download | rust-db95734b9d41e00c17bb934b96ffd8cb660a2248.tar.gz rust-db95734b9d41e00c17bb934b96ffd8cb660a2248.zip | |
Fix invalid creation of files in rustdoc
Diffstat (limited to 'src/librustdoc/visit_ast.rs')
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 22c8cc09243..fcf591a9328 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -313,7 +313,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { return false; } - let ret = match tcx.hir().get_by_def_id(res_did) { + let inlined = match tcx.hir().get_by_def_id(res_did) { // Bang macros are handled a bit on their because of how they are handled by the // compiler. If they have `#[doc(hidden)]` and the re-export doesn't have // `#[doc(inline)]`, then we don't inline it. @@ -344,7 +344,10 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { _ => false, }; self.view_item_stack.remove(&res_did); - ret + if inlined { + self.cx.cache.inlined_items.insert(res_did.to_def_id()); + } + inlined } /// Returns `true` if the item is visible, meaning it's not `#[doc(hidden)]` or private. |
