Skip to content

Commit e04f801

Browse files
committed
ffffffffffffffffff
1 parent 66aa1cd commit e04f801

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_mir_transform/src/simplify.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,12 @@ fn remove_unused_definitions_helper(used_locals: &mut UsedLocals, body: &mut Bod
568568

569569
if !used_locals.preserve_debug {
570570
body.var_debug_info.retain(|info| {
571-
let keep = debug_info_is_for_simple_local(info)
572-
.is_some_and(|local| used_locals.is_used(local));
571+
let keep = if let Some(local) = debug_info_is_for_simple_local(info) {
572+
used_locals.is_used(local)
573+
} else {
574+
// Keep non-simple debuginfo no matter what
575+
true
576+
};
573577

574578
if !keep {
575579
trace!("removing var_debug_info {:?}", info);

0 commit comments

Comments
 (0)