diff --git a/src/diagnostics.rs b/src/diagnostics.rs index d47f446716..c1b404a2e3 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -505,7 +505,7 @@ pub fn report_msg<'tcx>( let is_local = machine.is_local(frame_info); // No span for non-local frames and the first frame (which is the error site). if is_local && idx > 0 { - err.eager_subdiagnostic(err.dcx, frame_info.as_note(machine.tcx)); + err.subdiagnostic(err.dcx, frame_info.as_note(machine.tcx)); } else { let sm = sess.source_map(); let span = sm.span_to_embeddable_string(frame_info.span); diff --git a/tests/pass/overflow_checks_off.rs b/tests/pass/overflow_checks_off.rs index 79aa510ef9..7b9d4f8fff 100644 --- a/tests/pass/overflow_checks_off.rs +++ b/tests/pass/overflow_checks_off.rs @@ -1,12 +1,17 @@ //@compile-flags: -C overflow-checks=off // Check that we correctly implement the intended behavior of these operators -// when they are not being overflow-checked. +// when they are not being overflow-checked at runtime. // FIXME: if we call the functions in `std::ops`, we still get the panics. // Miri does not implement the codegen-time hack that backs `#[rustc_inherit_overflow_checks]`. // use std::ops::*; + +// Disable _compile-time_ overflow linting +// so that we can test runtime overflow checks + #![allow(arithmetic_overflow)] + fn main() { assert_eq!(-{ -0x80i8 }, -0x80);