Skip to content

Commit 7a19282

Browse files
committed
resolve: Remove module_expansion_untracked
1 parent 337d5b0 commit 7a19282

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,6 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10411041
self.root.tables.optimized_mir.get(self, id).is_some()
10421042
}
10431043

1044-
fn module_expansion(self, id: DefIndex, sess: &Session) -> ExpnId {
1045-
match self.def_kind(id) {
1046-
DefKind::Mod | DefKind::Enum | DefKind::Trait => self.get_expn_that_defined(id, sess),
1047-
_ => panic!("Expected module, found {:?}", self.local_def_id(id)),
1048-
}
1049-
}
1050-
10511044
fn get_fn_has_self_parameter(self, id: DefIndex, sess: &'a Session) -> bool {
10521045
self.root
10531046
.tables

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,6 @@ impl CStore {
533533
self.get_crate_data(def.krate).def_kind(def.index)
534534
}
535535

536-
pub fn module_expansion_untracked(&self, def_id: DefId, sess: &Session) -> ExpnId {
537-
self.get_crate_data(def_id.krate).module_expansion(def_id.index, sess)
538-
}
539-
540536
/// Only public-facing way to traverse all the definitions in a non-local crate.
541537
/// Critically useful for this third-party project: <https://github.com/hacspec/hacspec>.
542538
/// See <https://github.com/rust-lang/rust/pull/85889> for context.

compiler/rustc_resolve/src/build_reduced_graph.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
120120
.tcx
121121
.opt_parent(def_id)
122122
.map(|parent_id| self.get_nearest_non_block_module(parent_id));
123-
let expn_id = self.cstore().module_expansion_untracked(def_id, &self.tcx.sess);
124123
return Some(self.new_module(
125124
parent,
126125
ModuleKind::Def(def_kind, def_id, self.tcx.item_name(def_id)),
127-
expn_id,
126+
self.tcx.expn_that_defined(def_id),
128127
self.def_span(def_id),
129128
// FIXME: Account for `#[no_implicit_prelude]` attributes.
130129
parent.map_or(false, |module| module.no_implicit_prelude),

0 commit comments

Comments
 (0)