Skip to content

Commit 68f5b34

Browse files
committed
Use crate name for reexported extern crate paths
1 parent 29ffe51 commit 68f5b34

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc/ty/item_path.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
169169

170170
let data = cur_def_key.disambiguated_data.data;
171171
let symbol = data.get_opt_name().map(|n| n.as_str()).unwrap_or_else(|| {
172-
Symbol::intern("<unnamed>").as_str()
172+
if let DefPathData::CrateRoot = data { // reexported `extern crate` (#43189)
173+
self.original_crate_name(cur_def.krate).as_str()
174+
} else {
175+
Symbol::intern("<unnamed>").as_str()
176+
}
173177
});
174178
cur_path.push(symbol);
175179

0 commit comments

Comments
 (0)