metadata: Remove CrateMetadata::imported_name
It's entirely irrelevant to crate loading
This commit is contained in:
parent
032a53a06c
commit
b507971119
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user