Skip to content

Commit 51eb0c3

Browse files
Fix regression for private in public
1 parent 1f828f0 commit 51eb0c3

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/librustdoc/clean/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,7 @@ fn first_non_private<'tcx>(
15841584
if let Some(use_def_id) = reexp.id() &&
15851585
let Some(local_use_def_id) = use_def_id.as_local() &&
15861586
let Some(hir::Node::Item(item)) = hir.find_by_def_id(local_use_def_id) &&
1587+
!item.ident.name.is_empty() &&
15871588
let hir::ItemKind::Use(path, _) = item.kind
15881589
{
15891590
for res in &path.res {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub struct Ident;

tests/rustdoc/private-use.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Regression test for <https://github.com/rust-lang/rust/pull/113374> to
2+
// ensure it doesn't panic.
3+
4+
mod generics {
5+
pub enum WherePredicate {
6+
EqPredicate,
7+
}
8+
}
9+
pub mod visit {
10+
use *;
11+
pub fn visit_where_predicate<V>(_visitor: &mut V, _i: &WherePredicate) {}
12+
}
13+
pub use generics::*;

0 commit comments

Comments
 (0)