Skip to content

Commit

Permalink
Iterate def_ids map backwards to try first the latest mappings (it's …
Browse files Browse the repository at this point in the history
…a stack)
  • Loading branch information
spastorino committed Aug 9, 2022
1 parent e6478a3 commit 457ff7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl ResolverAstLoweringExt for ResolverAstLowering {
}

fn get_remapped_def_id(&self, mut local_def_id: LocalDefId) -> LocalDefId {
for map in &self.generics_def_id_map {
for map in self.generics_def_id_map.iter().rev() {
if let Some(r) = map.get(&local_def_id) {
debug!("def_id_remapper: remapping from `{local_def_id:?}` to `{r:?}`");
local_def_id = *r;
Expand Down

0 comments on commit 457ff7c

Please sign in to comment.