Skip to content

Commit

Permalink
Auto merge of rust-lang#104522 - RalfJung:try_normalize_after_erasing…
Browse files Browse the repository at this point in the history
…_regions, r=oli-obk

try_normalize_after_erasing_regions: promote an assertion to always run

In rust-lang/miri#2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.
  • Loading branch information
bors committed Nov 20, 2022
2 parents cd1f782 + 99f7e94 commit 7477c1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_traits/src/normalize_erasing_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ fn try_normalize_after_erasing_regions<'tcx, T: TypeFoldable<'tcx> + PartialEq +
// We don't care about the `obligations`; they are
// always only region relations, and we are about to
// erase those anyway:
debug_assert_eq!(
// This has been seen to fail in RL, so making it a non-debug assertion to better catch
// those cases.
assert_eq!(
normalized_obligations.iter().find(|p| not_outlives_predicate(p.predicate)),
None,
);
Expand Down

0 comments on commit 7477c1f

Please sign in to comment.