Skip to content
Merged
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: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/upvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}

// Anything else would be completely captured and therefore handled already.
_ => unreachable!(),
_ => unreachable!("unexpected base_path_ty: {base_path_ty:?}",),

@adwinwhite adwinwhite Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this accidental commit? doesn't really matter though.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated change while triaging ui tests, don't want to split this out into a separate commit

}
}

Expand Down
12 changes: 8 additions & 4 deletions compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ impl<'tcx> TyCtxt<'tcx> {
) {
let value = self.erase_and_anonymize_regions(value);
if value.has_aliases() {
assert_eq!(
value.clone(),
value.fold_with(&mut NormalizeAfterErasingRegionsFolder { tcx: self, typing_env })
)
// We want this check to also detect cases where an alias is incorrectly
// rigid in the current `TypingEnv`. This is the case if we use values
// which have been normalized in a different `TypingEnv` without
// renormalizing them. This was necessary to catch e.g. #163724.
let normalized = ty::set_aliases_to_non_rigid(self, value.clone())

@adwinwhite adwinwhite Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guards against uncaught typing env change? Should we have some comments here?

View changes since the review

.skip_normalization()
.fold_with(&mut NormalizeAfterErasingRegionsFolder { tcx: self, typing_env });
assert_eq!(value, normalized);
}
}

Expand Down
Loading