Iterate def_ids map backwards to try first the latest mappings (it's a stack)

This commit is contained in:
Santiago Pastorino 2022-08-09 16:33:19 -03:00
parent e6478a3724
commit 457ff7c56c
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -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;