Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3221,7 +3221,7 @@ fn clean_use_statement<'tcx>(
for (tree, hir_id, def_id) in items {
let mut segments = path.segments.to_vec();
segments.extend(tree.prefix.segments.iter());
if segments.last().unwrap().ident.name == kw::SelfLower {
if segments.last().is_some_and(|seg| seg.ident.name == kw::SelfLower) {
segments.pop();
}
let path = hir::UsePath {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ check-pass
//@ edition: 2015

// Regression test for <https://github.com/rust-lang/rust/issues/164158>.
// Nested glob use with no path prefix (edition 2015 form from review).

mod what {
use {*};
}
14 changes: 14 additions & 0 deletions tests/rustdoc-ui/ice-nested-use-without-prefix-164158.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ check-pass
//@ edition: 2021

// Regression test for <https://github.com/rust-lang/rust/issues/164158>.
// A nested use group with no path in front of it made rustdoc panic.

use {{}};

pub mod inner {
pub struct S;
pub struct T;
}

pub use {inner::S, {inner::T}};
Loading