about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-05-23 19:24:57 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-05-23 19:24:57 -0700
commit68f5b34b2c516f66df3a709c33c8bd8a449a95b2 (patch)
treee05939b7ef35f20da3b4bfc93118818237b97a0d /src
parent29ffe51e34ec0491806befadc4f820b132b50f9e (diff)
downloadrust-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.rs6
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);