Skip to content

Commit 5cbda2a

Browse files
committed
Fix tools
1 parent 3af45d6 commit 5cbda2a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/rustc_const_eval/src/interpret/eval_context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
737737
throw_ub_format!("unwinding past a stack frame that does not allow unwinding")
738738
}
739739
mir::UnwindAction::Terminate => {
740+
self.frame_mut().loc = Right(self.frame_mut().body.span);
740741
M::abort(self, "panic in a function that cannot unwind".to_owned())?;
741742
}
742743
};

src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,13 @@ fn check_terminator<'tcx>(
301301
| TerminatorKind::Goto { .. }
302302
| TerminatorKind::Return
303303
| TerminatorKind::Resume
304+
| TerminatorKind::Terminate
304305
| TerminatorKind::Unreachable => Ok(()),
305306

306307
TerminatorKind::Drop { place, .. } => check_place(tcx, *place, span, body),
307308

308309
TerminatorKind::SwitchInt { discr, targets: _ } => check_operand(tcx, discr, span, body),
309310

310-
TerminatorKind::Abort => Err((span, "abort is not stable in const fn".into())),
311311
TerminatorKind::GeneratorDrop | TerminatorKind::Yield { .. } => {
312312
Err((span, "const fn generators are unstable".into()))
313313
},

0 commit comments

Comments
 (0)