diff --git a/compiler/rustc_const_eval/messages.ftl b/compiler/rustc_const_eval/messages.ftl index eecc6690f5153..2de92d4cb96b7 100644 --- a/compiler/rustc_const_eval/messages.ftl +++ b/compiler/rustc_const_eval/messages.ftl @@ -100,7 +100,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 cc21a18af3a09..9dfd02acb64de 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::{DiagArgName, DiagArgValue, DiagMessage, Diagnostic, IntoDiagArg}; use rustc_middle::mir::AssertKind; use rustc_middle::mir::interpret::{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::{ ErrorHandled, Frame, InterpErrorInfo, InterpErrorKind, MachineStopType, err_inval, err_machine_stop, @@ -68,7 +69,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)); @@ -79,8 +80,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; @@ -91,21 +92,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); } } @@ -184,7 +183,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 a2635885098e3..316a7933c8d16 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -279,7 +279,7 @@ pub(crate) struct NonConstImplNote { pub span: Span, } -#[derive(Subdiagnostic, Clone)] +#[derive(Subdiagnostic, Clone, PartialEq, Eq, Hash)] #[note(const_eval_frame_note)] pub struct FrameNote { #[primary_span] diff --git a/tests/ui/consts/recursive.stderr b/tests/ui/consts/recursive.stderr index 0046005c74f09..21369c083d22a 100644 --- a/tests/ui/consts/recursive.stderr +++ b/tests/ui/consts/recursive.stderr @@ -20,7 +20,7 @@ note: inside `f::` | LL | f(x); | ^^^^ -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 7575ad730b304..84038d9c05a15 100644 --- a/tests/ui/consts/uninhabited-const-issue-61744.stderr +++ b/tests/ui/consts/uninhabited-const-issue-61744.stderr @@ -14,622 +14,7 @@ note: inside `hint_unreachable` | LL | fake_type() | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` - --> $DIR/uninhabited-const-issue-61744.rs:8:5 - | -LL | fake_type() - | ^^^^^^^^^^^ -note: inside `fake_type::` - --> $DIR/uninhabited-const-issue-61744.rs:4:5 - | -LL | hint_unreachable() - | ^^^^^^^^^^^^^^^^^^ -note: inside `hint_unreachable` +note: [... 124 additional calls ...] inside `hint_unreachable` --> $DIR/uninhabited-const-issue-61744.rs:8:5 | LL | fake_type() 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 46769cdea8a75..472410f267926 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 `inner` | LL | #[cfg(r#return)] _ => return inner(acc + 1, n - 1), | ^^^^^^^^^^^^^^^^^^^^^ -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 fd5a3c3c5464d..ea0216590fbd8 100644 --- a/tests/ui/infinite/infinite-recursion-const-fn.stderr +++ b/tests/ui/infinite/infinite-recursion-const-fn.stderr @@ -14,631 +14,11 @@ note: inside `b` | 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` - --> $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 `ARR::{constant#0}` --> $DIR/infinite-recursion-const-fn.rs:9:18 |