Use crate name for reexported extern crate paths
This commit is contained in:
parent
29ffe51e34
commit
68f5b34b2c
1 changed files with 5 additions and 1 deletions
|
|
@ -169,7 +169,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
|||
|
||||
let data = cur_def_key.disambiguated_data.data;
|
||||
let symbol = data.get_opt_name().map(|n| n.as_str()).unwrap_or_else(|| {
|
||||
Symbol::intern("<unnamed>").as_str()
|
||||
if let DefPathData::CrateRoot = data { // reexported `extern crate` (#43189)
|
||||
self.original_crate_name(cur_def.krate).as_str()
|
||||
} else {
|
||||
Symbol::intern("<unnamed>").as_str()
|
||||
}
|
||||
});
|
||||
cur_path.push(symbol);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue