about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-09-29 18:51:09 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-10-04 01:12:28 +0300
commitb507971119198600a9afca52f76a0a8441160152 (patch)
tree4e3bf5420a40db0954465f972686d8653073b988 /src
parent032a53a06ce293571e51bbe621a5c480e8a28e95 (diff)
downloadrust-b507971119198600a9afca52f76a0a8441160152.tar.gz
rust-b507971119198600a9afca52f76a0a8441160152.zip
metadata: Remove `CrateMetadata::imported_name`
It's entirely irrelevant to crate loading
Diffstat (limited to 'src')
-rw-r--r--src/librustc_metadata/creader.rs2
-rw-r--r--src/librustc_metadata/cstore.rs4
-rw-r--r--src/librustc_metadata/cstore_impl.rs3
3 files changed, 1 insertions, 8 deletions
diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs
index 682835d81a6..69e9c6eb83b 100644
--- a/src/librustc_metadata/creader.rs
+++ b/src/librustc_metadata/creader.rs
@@ -207,7 +207,6 @@ impl<'a> CrateLoader<'a> {
         info!("register crate `extern crate {} as {}` (private_dep = {})",
             crate_root.name, ident, private_dep);
 
-
         // Claim this crate number and cache it
         let cnum = self.cstore.alloc_new_crate_num();
 
@@ -255,7 +254,6 @@ impl<'a> CrateLoader<'a> {
 
         let cmeta = cstore::CrateMetadata {
             name: crate_root.name,
-            imported_name: ident,
             extern_crate: Lock::new(None),
             def_path_table: Lrc::new(def_path_table),
             trait_impls,
diff --git a/src/librustc_metadata/cstore.rs b/src/librustc_metadata/cstore.rs
index d3619b2f5de..ed43aad38be 100644
--- a/src/librustc_metadata/cstore.rs
+++ b/src/librustc_metadata/cstore.rs
@@ -49,10 +49,6 @@ pub struct CrateMetadata {
     /// Original name of the crate.
     pub name: Symbol,
 
-    /// Name of the crate as imported. I.e., if imported with
-    /// `extern crate foo as bar;` this will be `bar`.
-    pub imported_name: Symbol,
-
     /// Information about the extern crate that caused this crate to
     /// be loaded. If this is `None`, then the crate was injected
     /// (e.g., by the allocator)
diff --git a/src/librustc_metadata/cstore_impl.rs b/src/librustc_metadata/cstore_impl.rs
index edb6f594fdd..b5366769fff 100644
--- a/src/librustc_metadata/cstore_impl.rs
+++ b/src/librustc_metadata/cstore_impl.rs
@@ -453,8 +453,7 @@ impl cstore::CStore {
         }
 
         let def = data.get_macro(id.index);
-        let macro_full_name = data.def_path(id.index)
-            .to_string_friendly(|_| data.imported_name);
+        let macro_full_name = data.def_path(id.index).to_string_friendly(|_| data.name);
         let source_name = FileName::Macros(macro_full_name);
 
         let source_file = sess.parse_sess.source_map().new_source_file(source_name, def.body);