Skip to content

Commit 799e822

Browse files
committed
Rustdoc render public underscore_imports as Re-exports
Fixes #61592
1 parent 11c94a1 commit 799e822

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,8 @@ impl Clean<Vec<Item>> for doctree::Import<'_> {
21712171
}
21722172
None => false,
21732173
}
2174-
});
2174+
})
2175+
|| (self.vis.node.is_pub() && self.name == kw::Underscore);
21752176
// Also check whether imports were asked to be inlined, in case we're trying to re-export a
21762177
// crate in Rust 2018+
21772178
let please_inline = self.attrs.lists(sym::doc).has_word(sym::inline);

src/test/rustdoc/issue-61592.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub mod foo {
2+
pub struct Foo;
3+
}
4+
5+
// @has issue_61592/index.html
6+
// @has - '//*[@href="#reexports"]' 'Re-exports'
7+
pub use foo::Foo as _;

0 commit comments

Comments
 (0)