Skip to content
Permalink
Browse files

metadata: Remove `CrateMetadata::imported_name`

It's entirely irrelevant to crate loading
  • Loading branch information...
petrochenkov committed Sep 29, 2019
1 parent 032a53a commit b507971119198600a9afca52f76a0a8441160152
Showing with 1 addition and 8 deletions.
  1. +0 −2 src/librustc_metadata/creader.rs
  2. +0 −4 src/librustc_metadata/cstore.rs
  3. +1 −2 src/librustc_metadata/cstore_impl.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,
@@ -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)
@@ -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);

0 comments on commit b507971

Please sign in to comment.
You can’t perform that action at this time.