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 | |
parent | Auto merge of #50916 - oli-obk:miri, r=eddyb (diff) | |
download | grust-68f5b34b2c516f66df3a709c33c8bd8a449a95b2.tar.gz grust-68f5b34b2c516f66df3a709c33c8bd8a449a95b2.tar.bz2 grust-68f5b34b2c516f66df3a709c33c8bd8a449a95b2.tar.xz |
Use crate name for reexported `extern crate` paths
-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 93d78210b1..87ace45a90 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> { | |||
169 | 169 | ||
170 | let data = cur_def_key.disambiguated_data.data; | 170 | let data = cur_def_key.disambiguated_data.data; |
171 | let symbol = data.get_opt_name().map(|n| n.as_str()).unwrap_or_else(|| { | 171 | 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 | } | ||
173 | }); | 177 | }); |
174 | cur_path.push(symbol); | 178 | cur_path.push(symbol); |
175 | 179 | ||