Fix regression for private in public

This commit is contained in:
Guillaume Gomez 2023-07-25 23:14:09 +02:00
parent 1f828f0155
commit 51eb0c3b36
3 changed files with 15 additions and 0 deletions

View File

@ -1584,6 +1584,7 @@ fn first_non_private<'tcx>(
if let Some(use_def_id) = reexp.id() &&
let Some(local_use_def_id) = use_def_id.as_local() &&
let Some(hir::Node::Item(item)) = hir.find_by_def_id(local_use_def_id) &&
!item.ident.name.is_empty() &&
let hir::ItemKind::Use(path, _) = item.kind
{
for res in &path.res {

View File

@ -0,0 +1 @@
pub struct Ident;

View File

@ -0,0 +1,13 @@
// Regression test for <https://github.com/rust-lang/rust/pull/113374> to
// ensure it doesn't panic.
mod generics {
pub enum WherePredicate {
EqPredicate,
}
}
pub mod visit {
use *;
pub fn visit_where_predicate<V>(_visitor: &mut V, _i: &WherePredicate) {}
}
pub use generics::*;