Skip to content

Remove dead field is_import from Export. #47092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/librustc/hir/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ pub struct Export {
/// The visibility of the export.
/// We include non-`pub` exports for hygienic macros that get used from extern crates.
pub vis: ty::Visibility,
/// True if from a `use` or and `extern crate`.
pub is_import: bool,
}

impl CtorKind {
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/ich/impls_hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,7 @@ impl_stable_hash_for!(struct hir::def::Export {
ident,
def,
vis,
span,
is_import
span
});

impl<'gcx> HashStable<StableHashingContext<'gcx>>
Expand Down
9 changes: 3 additions & 6 deletions src/librustc_metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,6 @@ impl<'a, 'tcx> CrateMetadata {
def: def,
vis: ty::Visibility::Public,
span: DUMMY_SP,
is_import: false,
});
}
}
Expand Down Expand Up @@ -684,7 +683,6 @@ impl<'a, 'tcx> CrateMetadata {
ident: Ident::from_str(&self.item_name(child_index)),
vis: self.get_visibility(child_index),
span: self.entry(child_index).span.decode((self, sess)),
is_import: false,
});
}
}
Expand All @@ -702,8 +700,7 @@ impl<'a, 'tcx> CrateMetadata {
(self.get_def(child_index), def_key.disambiguated_data.data.get_opt_name()) {
let ident = Ident::from_str(&name);
let vis = self.get_visibility(child_index);
let is_import = false;
callback(def::Export { def, ident, vis, span, is_import });
callback(def::Export { def, ident, vis, span });
// For non-reexport structs and variants add their constructors to children.
// Reexport lists automatically contain constructors when necessary.
match def {
Expand All @@ -714,7 +711,7 @@ impl<'a, 'tcx> CrateMetadata {
callback(def::Export {
def: ctor_def,
vis: self.get_visibility(ctor_def_id.index),
ident, span, is_import,
ident, span
});
}
}
Expand All @@ -724,7 +721,7 @@ impl<'a, 'tcx> CrateMetadata {
let ctor_kind = self.get_ctor_kind(child_index);
let ctor_def = Def::VariantCtor(def_id, ctor_kind);
let vis = self.get_visibility(child_index);
callback(def::Export { def: ctor_def, ident, vis, span, is_import });
callback(def::Export { def: ctor_def, ident, vis, span });
}
_ => {}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ impl<'a> Resolver<'a> {
let result = self.resolve_ident_in_module(module, ident, MacroNS, false, false, span);
if let Ok(binding) = result {
let (def, vis) = (binding.def(), binding.vis);
self.macro_exports.push(Export { ident, def, vis, span, is_import: true });
self.macro_exports.push(Export { ident, def, vis, span });
} else {
span_err!(self.session, span, E0470, "reexported macro not found");
}
Expand Down
1 change: 0 additions & 1 deletion src/librustc_resolve/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@ impl<'a> Resolver<'a> {
def: def,
vis: ty::Visibility::Public,
span: item.span,
is_import: false,
});
} else {
self.unused_macros.insert(def_id);
Expand Down
1 change: 0 additions & 1 deletion src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,6 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
def: def,
span: binding.span,
vis: binding.vis,
is_import: true,
});
}
}
Expand Down