diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-05-23 19:24:57 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2018-05-23 19:24:57 -0700 |
| commit | 68f5b34b2c516f66df3a709c33c8bd8a449a95b2 (patch) | |
| tree | e05939b7ef35f20da3b4bfc93118818237b97a0d /src | |
| parent | 29ffe51e34ec0491806befadc4f820b132b50f9e (diff) | |
| download | rust-68f5b34b2c516f66df3a709c33c8bd8a449a95b2.tar.gz rust-68f5b34b2c516f66df3a709c33c8bd8a449a95b2.zip | |
Use crate name for reexported `extern crate` paths
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/ty/item_path.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc/ty/item_path.rs b/src/librustc/ty/item_path.rs index 93d78210b1a..87ace45a905 100644 --- a/src/librustc/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -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); |
