Skip to content

Commit c80ffcb

Browse files
committed
metadata: Remove CrateMetadata::imported_name
It's entirely irrelevant to crate loading
1 parent f2023ac commit c80ffcb

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

src/librustc_metadata/creader.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ impl<'a> CrateLoader<'a> {
207207
info!("register crate `extern crate {} as {}` (private_dep = {})",
208208
crate_root.name, ident, private_dep);
209209

210-
211210
// Claim this crate number and cache it
212211
let cnum = self.cstore.alloc_new_crate_num();
213212

@@ -255,7 +254,6 @@ impl<'a> CrateLoader<'a> {
255254

256255
let cmeta = cstore::CrateMetadata {
257256
name: crate_root.name,
258-
imported_name: ident,
259257
extern_crate: Lock::new(None),
260258
def_path_table: Lrc::new(def_path_table),
261259
trait_impls,

src/librustc_metadata/cstore.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ pub struct CrateMetadata {
4949
/// Original name of the crate.
5050
pub name: Symbol,
5151

52-
/// Name of the crate as imported. I.e., if imported with
53-
/// `extern crate foo as bar;` this will be `bar`.
54-
pub imported_name: Symbol,
55-
5652
/// Information about the extern crate that caused this crate to
5753
/// be loaded. If this is `None`, then the crate was injected
5854
/// (e.g., by the allocator)

src/librustc_metadata/cstore_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ impl cstore::CStore {
453453
}
454454

455455
let def = data.get_macro(id.index);
456-
let macro_full_name = data.def_path(id.index)
457-
.to_string_friendly(|_| data.imported_name);
456+
let macro_full_name = data.def_path(id.index).to_string_friendly(|_| data.name);
458457
let source_name = FileName::Macros(macro_full_name);
459458

460459
let source_file = sess.parse_sess.source_map().new_source_file(source_name, def.body);

0 commit comments

Comments
 (0)