Use crate name for reexported extern crate paths

This commit is contained in:
Esteban Küber 2018-05-23 19:24:57 -07:00
parent 29ffe51e34
commit 68f5b34b2c

View file

@ -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);