From f12ab2790d9405df290ee4e890c60239c08a7fda Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 21 Jun 2025 23:32:54 +0000 Subject: [PATCH] Do not flood if state is empty. --- compiler/rustc_mir_transform/src/jump_threading.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_mir_transform/src/jump_threading.rs b/compiler/rustc_mir_transform/src/jump_threading.rs index 9b420ab18112..72c003e9c575 100644 --- a/compiler/rustc_mir_transform/src/jump_threading.rs +++ b/compiler/rustc_mir_transform/src/jump_threading.rs @@ -345,6 +345,9 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { extra_elem: Option, state: &mut ConditionSet<'a>, ) { + if state.is_empty() { + return; + } let mut places_to_exclude = FxHashSet::default(); self.map.for_each_aliasing_place(place.as_ref(), extra_elem, &mut |vi| { places_to_exclude.insert(vi);