diff --git a/compiler/rustc_const_eval/messages.ftl b/compiler/rustc_const_eval/messages.ftl index aa0bc42d44850..3a93ccd6c04ec 100644 --- a/compiler/rustc_const_eval/messages.ftl +++ b/compiler/rustc_const_eval/messages.ftl @@ -117,7 +117,7 @@ const_eval_fn_ptr_call = function pointers need an RFC before allowed to be called in {const_eval_const_context}s const_eval_frame_note = {$times -> [0] {const_eval_frame_note_inner} - *[other] [... {$times} additional calls {const_eval_frame_note_inner} ...] + *[other] [... {$times} additional calls ...] {const_eval_frame_note_inner} } const_eval_frame_note_inner = inside {$where_ -> diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs index 3e880d0200133..fe6e42570b22f 100644 --- a/compiler/rustc_const_eval/src/const_eval/error.rs +++ b/compiler/rustc_const_eval/src/const_eval/error.rs @@ -1,5 +1,6 @@ use std::mem; +use rustc_data_structures::fx::FxHashSet; use rustc_errors::{Diag, DiagArgName, DiagArgValue, DiagMessage, IntoDiagArg}; use rustc_middle::mir::AssertKind; use rustc_middle::mir::interpret::{AllocId, Provenance, ReportedErrorInfo}; @@ -9,7 +10,7 @@ use rustc_middle::ty::{ConstInt, TyCtxt}; use rustc_span::{Span, Symbol}; use super::CompileTimeMachine; -use crate::errors::{self, FrameNote, ReportErrorExt}; +use crate::errors::{FrameNote, ReportErrorExt}; use crate::interpret::{ CtfeProvenance, ErrorHandled, Frame, InterpErrorInfo, InterpErrorKind, MachineStopType, Pointer, err_inval, err_machine_stop, @@ -93,7 +94,7 @@ impl<'tcx> Into> for ConstEvalErrKind { pub fn get_span_and_frames<'tcx>( tcx: TyCtxtAt<'tcx>, stack: &[Frame<'tcx, impl Provenance, impl Sized>], -) -> (Span, Vec) { +) -> (Span, Vec) { let mut stacktrace = Frame::generate_stacktrace_from_stack(stack); // Filter out `requires_caller_location` frames. stacktrace.retain(|frame| !frame.instance.def.requires_caller_location(*tcx)); @@ -104,8 +105,8 @@ pub fn get_span_and_frames<'tcx>( // Add notes to the backtrace. Don't print a single-line backtrace though. if stacktrace.len() > 1 { // Helper closure to print duplicated lines. - let mut add_frame = |mut frame: errors::FrameNote| { - frames.push(errors::FrameNote { times: 0, ..frame.clone() }); + let mut add_frame = |mut frame: FrameNote| { + frames.push(FrameNote { times: 0, ..frame.clone() }); // Don't print [... additional calls ...] if the number of lines is small if frame.times < 3 { let times = frame.times; @@ -116,21 +117,19 @@ pub fn get_span_and_frames<'tcx>( } }; - let mut last_frame: Option = None; + let mut last_frame: Option = None; + let mut seen = FxHashSet::default(); for frame_info in &stacktrace { let frame = frame_info.as_note(*tcx); match last_frame.as_mut() { - Some(last_frame) - if last_frame.span == frame.span - && last_frame.where_ == frame.where_ - && last_frame.instance == frame.instance => - { + Some(last_frame) if !seen.insert(frame.clone()) => { last_frame.times += 1; } Some(last_frame) => { add_frame(mem::replace(last_frame, frame)); } None => { + seen.insert(frame.clone()); last_frame = Some(frame); } } @@ -219,7 +218,7 @@ pub(super) fn lint<'tcx, L>( tcx: TyCtxtAt<'tcx>, machine: &CompileTimeMachine<'tcx>, lint: &'static rustc_session::lint::Lint, - decorator: impl FnOnce(Vec) -> L, + decorator: impl FnOnce(Vec) -> L, ) where L: for<'a> rustc_errors::LintDiagnostic<'a, ()>, { diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index b6a64035261e5..ed4c4e0a18c17 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -264,7 +264,7 @@ pub(crate) struct NonConstImplNote { pub span: Span, } -#[derive(Clone)] +#[derive(Clone, PartialEq, Eq, Hash)] pub struct FrameNote { pub span: Span, pub times: i32, diff --git a/tests/ui/consts/recursive.stderr b/tests/ui/consts/recursive.stderr index a382fabf7b7e8..802c87859f900 100644 --- a/tests/ui/consts/recursive.stderr +++ b/tests/ui/consts/recursive.stderr @@ -15,7 +15,7 @@ error[E0080]: reached the configured maximum number of stack frames LL | const X: () = f(1); | ^^^^ evaluation of `X` failed inside this call | -note: [... 126 additional calls inside `f::` ...] +note: [... 126 additional calls ...] inside `f::` --> $DIR/recursive.rs:4:5 | LL | f(x); diff --git a/tests/ui/consts/uninhabited-const-issue-61744.stderr b/tests/ui/consts/uninhabited-const-issue-61744.stderr index cae4f8c33239f..53f0f97878c39 100644 --- a/tests/ui/consts/uninhabited-const-issue-61744.stderr +++ b/tests/ui/consts/uninhabited-const-issue-61744.stderr @@ -9,626 +9,11 @@ note: inside `fake_type::` | LL | hint_unreachable() | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:9:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` +note: [... 124 additional calls ...] inside `hint_unreachable` --> $DIR/uninhabited-const-issue-61744.rs:9:5 | LL | fake_type() | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:5:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ note: inside `hint_unreachable` --> $DIR/uninhabited-const-issue-61744.rs:9:5 | diff --git a/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr b/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr index 25e30397c8322..458b7f885b446 100644 --- a/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr +++ b/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr @@ -9,7 +9,7 @@ note: inside `rec_id` | LL | inner(0, n) | ^^^^^^^^^^^ -note: [... 125 additional calls inside `inner` ...] +note: [... 125 additional calls ...] inside `inner` --> $DIR/ctfe-id-unlimited.rs:17:42 | LL | #[cfg(r#return)] _ => return inner(acc + 1, n - 1), diff --git a/tests/ui/infinite/infinite-recursion-const-fn.stderr b/tests/ui/infinite/infinite-recursion-const-fn.stderr index f5f6e2a58fd11..deb8731246da3 100644 --- a/tests/ui/infinite/infinite-recursion-const-fn.stderr +++ b/tests/ui/infinite/infinite-recursion-const-fn.stderr @@ -4,631 +4,11 @@ error[E0080]: reached the configured maximum number of stack frames LL | const ARR: [i32; a()] = [5; 6]; | ^^^ evaluation of `ARR::{constant#0}` failed inside this call | -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` - --> $DIR/infinite-recursion-const-fn.rs:7:5 - | -LL | a() - | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ -note: inside `b` +note: [... 125 additional calls ...] inside `b` --> $DIR/infinite-recursion-const-fn.rs:7:5 | LL | a() | ^^^ -note: inside `a` - --> $DIR/infinite-recursion-const-fn.rs:4:5 - | -LL | b() - | ^^^ note: inside `b` --> $DIR/infinite-recursion-const-fn.rs:7:5 |