Skip to content

Commit 1ee67b5

Browse files
committed
turn expensive assert into debug assertion
1 parent 3c2a328 commit 1ee67b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_borrowck/src/polonius/typeck_constraints.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ fn localize_statement_constraint<'tcx>(
9494
// - and that should be impossible in MIR
9595
//
9696
// When we have a more complete implementation in the future, tested with crater, etc,
97-
// we can relax this to a debug assert instead, or remove it.
98-
assert!(
97+
// we can remove this assertion. It's a debug assert because it can be expensive.
98+
debug_assert!(
9999
{
100100
let mut lhs_regions = FxHashSet::default();
101101
tcx.for_each_free_region(lhs, |region| {
@@ -183,6 +183,7 @@ fn localize_terminator_constraint<'tcx>(
183183
}
184184
}
185185
}
186+
186187
/// For a given outlives constraint and CFG edge, returns the localized constraint with the
187188
/// appropriate `from`-`to` direction. This is computed according to whether the constraint flows to
188189
/// or from a free region in the given `value`, some kind of result for an effectful operation, like

0 commit comments

Comments
 (0)