about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
diff options
context:
space:
mode:
authorRémy Rakic <remy.rakic+github@gmail.com>2025-06-18 09:01:57 +0000
committerRémy Rakic <remy.rakic+github@gmail.com>2025-08-08 15:14:51 +0000
commitd4bbd681bbdb2b47717922e46bd022dbf2535403 (patch)
tree6508f81cf316d3b0b849d0808e34c055cdd3db23 /compiler/rustc_borrowck/src
parent13308988b051ebe014a061b9d595cbb8289348d1 (diff)
downloadrust-d4bbd681bbdb2b47717922e46bd022dbf2535403.tar.gz
rust-d4bbd681bbdb2b47717922e46bd022dbf2535403.zip
turn expensive assert into debug assertion
Diffstat (limited to 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/polonius/typeck_constraints.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/polonius/typeck_constraints.rs b/compiler/rustc_borrowck/src/polonius/typeck_constraints.rs
index 8106d1e4af0..e4e52962bf7 100644
--- a/compiler/rustc_borrowck/src/polonius/typeck_constraints.rs
+++ b/compiler/rustc_borrowck/src/polonius/typeck_constraints.rs
@@ -94,8 +94,8 @@ fn localize_statement_constraint<'tcx>(
             // - and that should be impossible in MIR
             //
             // When we have a more complete implementation in the future, tested with crater, etc,
-            // we can relax this to a debug assert instead, or remove it.
-            assert!(
+            // we can remove this assertion. It's a debug assert because it can be expensive.
+            debug_assert!(
                 {
                     let mut lhs_regions = FxHashSet::default();
                     tcx.for_each_free_region(lhs, |region| {
@@ -183,6 +183,7 @@ fn localize_terminator_constraint<'tcx>(
         }
     }
 }
+
 /// For a given outlives constraint and CFG edge, returns the localized constraint with the
 /// appropriate `from`-`to` direction. This is computed according to whether the constraint flows to
 /// or from a free region in the given `value`, some kind of result for an effectful operation, like