From 2c7186a72534aab96d1ae1fbe9e78c047c8105d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Wed, 3 Jun 2026 00:06:55 +0000 Subject: [PATCH] Reduce verbosity of cycle errors when possible When pointing at each step of cycle errors, do not include the code snippet when the note points at the same place as the previous one (by setting the note's span to DUMMY_SP). --- compiler/rustc_query_impl/src/error.rs | 3 +- compiler/rustc_query_impl/src/job.rs | 17 ++-- src/tools/miri/tests/fail/layout_cycle.stderr | 2 +- .../private-type-cycle-dyn-110629.stderr | 2 +- .../defaults-cyclic-fail.stderr | 2 +- ...9-assoc-const-static-recursion-impl.stderr | 20 +---- ...onst-static-recursion-trait-default.stderr | 14 +-- ...-assoc-const-static-recursion-trait.stderr | 20 +---- .../ambiguous-associated-type2.stderr | 8 +- .../implied-bounds-cycle.stderr | 2 +- .../impl-trait-in-trait.stderr | 14 +-- .../associated-types/impl-wf-cycle-4.stderr | 18 +--- tests/ui/associated-types/issue-20825.stderr | 8 +- ...erence-inherited-assoc-ty-cycle-err.stderr | 8 +- .../generic_const_exprs/closures.stderr | 14 +-- .../not_wf_param_in_rpitit.stderr | 2 +- tests/ui/consts/const-size_of-cycle.stderr | 17 +--- tests/ui/consts/issue-103790.stderr | 2 +- tests/ui/consts/issue-36163.stderr | 8 +- tests/ui/consts/issue-44415.stderr | 20 +---- .../recursive-const-stack-overflow.stderr | 28 ++---- .../recursive-zst-static.default.stderr | 2 +- .../recursive-zst-static.unleash.stderr | 2 +- .../cycle-trait-default-type-trait.stderr | 2 +- .../cycle-trait-supertrait-direct.stderr | 2 +- .../cycle-trait-supertrait-indirect.stderr | 2 +- tests/ui/cycle-trait/issue-12511.stderr | 2 +- .../ui/delegation/unsupported.current.stderr | 28 ++---- tests/ui/delegation/unsupported.next.stderr | 28 ++---- .../unknown-lifetime-ice-119827.stderr | 8 +- .../auto-trait-leakage/auto-trait-leak.stderr | 56 +++--------- ...atability-via-leakage-cycle.current.stderr | 38 ++------ ...ompatability-via-leakage-cycle.next.stderr | 38 ++------ .../in-trait/return-type-notation.stderr | 14 +-- .../infinite-trait-alias-recursion.stderr | 2 +- ...pe-alias-mutual-recursion.gated_new.stderr | 2 +- ...pe-alias-mutual-recursion.gated_old.stderr | 2 +- .../infinite-vec-type-recursion.gated.stderr | 2 +- tests/ui/issues/issue-34373.stderr | 2 +- tests/ui/layout/layout-cycle.stderr | 2 +- tests/ui/layout/post-mono-layout-cycle.stderr | 2 +- tests/ui/offset-of/inside-array-length.stderr | 38 ++------ .../cycle_crash-issue-135870.stderr | 14 +-- ...ult-trait-shadow-cycle-issue-151358.stderr | 2 +- ...c-const-exprs-deadlock-issue-134978.stderr | 14 +-- ...ested-type-alias-cycle-issue-129911.stderr | 22 ++--- ...on-structural-match-types-cycle-err.stderr | 44 ++-------- .../query-cycle-printing-issue-151358.stderr | 2 +- tests/ui/recursion/issue-23302-1.stderr | 8 +- tests/ui/recursion/issue-23302-2.stderr | 8 +- tests/ui/recursion/issue-23302-3.stderr | 20 +---- .../issue-26548-recursion-via-normalize.rs | 4 +- ...issue-26548-recursion-via-normalize.stderr | 5 +- .../resolve/query-cycle-issue-124901.stderr | 2 +- tests/ui/resolve/resolve-self-in-impl.stderr | 2 +- tests/ui/sized/recursive-type-binding.stderr | 2 +- .../recursive-type-coercion-from-never.stderr | 2 +- .../stack-overflow-trait-infer-98842.stderr | 2 +- tests/ui/specialization/issue-39448.stderr | 2 +- tests/ui/specialization/issue-39618.stderr | 2 +- .../alias/infinite_normalization.stderr | 2 +- .../unsatisfied-const-trait-bound.stderr | 88 ++++--------------- ...cursive-enum-and-array-impl.current.stderr | 2 +- ...-recursive-enum-and-array-impl.next.stderr | 2 +- .../solver-cycles/assoc-equality-cycle.stderr | 8 +- .../solver-cycles/self-item-cycle.stderr | 8 +- .../cyclic-trait-resolution.stderr | 4 +- .../self-in-enum-definition.stderr | 8 +- .../in-where-clause.stderr | 42 ++------- ...ir-wf-check-anon-const-issue-122199.stderr | 2 +- ...ir-wf-check-anon-const-issue-122989.stderr | 2 +- 71 files changed, 204 insertions(+), 624 deletions(-) diff --git a/compiler/rustc_query_impl/src/error.rs b/compiler/rustc_query_impl/src/error.rs index 54c2d96078c67..834c3cec6993e 100644 --- a/compiler/rustc_query_impl/src/error.rs +++ b/compiler/rustc_query_impl/src/error.rs @@ -75,7 +75,8 @@ pub(crate) struct Cycle { #[subdiagnostic] pub cycle_usage: Option, #[note( - "see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information" + "for more information, see \ + and " )] pub note_span: (), } diff --git a/compiler/rustc_query_impl/src/job.rs b/compiler/rustc_query_impl/src/job.rs index bf0493b29fd1e..5760f05c4a367 100644 --- a/compiler/rustc_query_impl/src/job.rs +++ b/compiler/rustc_query_impl/src/job.rs @@ -429,16 +429,23 @@ pub(crate) fn create_cycle_error<'tcx>( StackCount::Multiple { stack_bottom: stack_bottom.clone() } }; + let mut prev = span; for i in 1..frames.len() { let frame = &frames[i]; let span = frame.tagged_key.catch_default_span(tcx, frames[(i + 1) % frames.len()].span); - cycle_stack - .push(crate::error::CycleStack { span, desc: frame.tagged_key.catch_description(tcx) }); + cycle_stack.push(crate::error::CycleStack { + span: if span == prev { DUMMY_SP } else { span }, + desc: frame.tagged_key.catch_description(tcx), + }); + prev = span; } - let cycle_usage = usage.as_ref().map(|usage| crate::error::CycleUsage { - span: usage.tagged_key.catch_default_span(tcx, usage.span), - usage: usage.tagged_key.catch_description(tcx), + let cycle_usage = usage.as_ref().map(|usage| { + let cycle_span = usage.tagged_key.catch_default_span(tcx, usage.span); + crate::error::CycleUsage { + span: if cycle_span != span { cycle_span } else { DUMMY_SP }, + usage: usage.tagged_key.catch_description(tcx), + } }); let is_all_def_kind = |def_kind| { diff --git a/src/tools/miri/tests/fail/layout_cycle.stderr b/src/tools/miri/tests/fail/layout_cycle.stderr index 1efbe239016e0..c9ed939f754e2 100644 --- a/src/tools/miri/tests/fail/layout_cycle.stderr +++ b/src/tools/miri/tests/fail/layout_cycle.stderr @@ -15,7 +15,7 @@ note: cycle used when const-evaluating + checking `core::mem::SizedTypePropertie | LL | const SIZE: usize = intrinsics::size_of::(); | ^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr b/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr index 6ee7e4b781c5b..c6c1473d288bd 100644 --- a/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr +++ b/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr @@ -13,7 +13,7 @@ note: cycle used when checking that `Bar` is well-formed | LL | type Bar<'a, 'b> = Box>>; | ^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-consts/defaults-cyclic-fail.stderr b/tests/ui/associated-consts/defaults-cyclic-fail.stderr index 31974d955611f..bcaf7e2831e49 100644 --- a/tests/ui/associated-consts/defaults-cyclic-fail.stderr +++ b/tests/ui/associated-consts/defaults-cyclic-fail.stderr @@ -25,7 +25,7 @@ note: cycle used when optimizing promoted MIR for `main` | LL | assert_eq!(<() as Tr>::A, 0); | ^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr index 718854c59f4ff..41290a2e51a89 100644 --- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr +++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr @@ -4,28 +4,16 @@ error[E0391]: cycle detected when checking if `IMPL_REF_BAR` is a trivial const LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; | ^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires building MIR for `IMPL_REF_BAR`... - --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1 - | -LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which requires building MIR for `IMPL_REF_BAR`... note: ...which requires checking if `::BAR` is a trivial const... --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5 | LL | const BAR: u32 = IMPL_REF_BAR; | ^^^^^^^^^^^^^^ -note: ...which requires building MIR for `::BAR`... - --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5 - | -LL | const BAR: u32 = IMPL_REF_BAR; - | ^^^^^^^^^^^^^^ + = note: ...which requires building MIR for `::BAR`... = note: ...which again requires checking if `IMPL_REF_BAR` is a trivial const, completing the cycle -note: cycle used when simplifying constant for the type system `IMPL_REF_BAR` - --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1 - | -LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when simplifying constant for the type system `IMPL_REF_BAR` + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr index d0ada37b99edd..e33111f3f8d9b 100644 --- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr +++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr @@ -24,18 +24,10 @@ note: ...which requires simplifying constant for the type system `FooDefault::BA | LL | const BAR: u32 = DEFAULT_REF_BAR; | ^^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `FooDefault::BAR`... - --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5 - | -LL | const BAR: u32 = DEFAULT_REF_BAR; - | ^^^^^^^^^^^^^^ + = note: ...which requires const-evaluating + checking `FooDefault::BAR`... = note: ...which again requires caching mir of `FooDefault::BAR` for CTFE, completing the cycle -note: cycle used when const-evaluating + checking `FooDefault::BAR` - --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5 - | -LL | const BAR: u32 = DEFAULT_REF_BAR; - | ^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when const-evaluating + checking `FooDefault::BAR` + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr index 842b5328024b0..d7e6cc8f0b88d 100644 --- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr +++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr @@ -14,28 +14,16 @@ note: ...which requires simplifying constant for the type system `::BAR`... - --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5 - | -LL | const BAR: u32 = TRAIT_REF_BAR; - | ^^^^^^^^^^^^^^ -note: ...which requires caching mir of `::BAR` for CTFE... - --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5 - | -LL | const BAR: u32 = TRAIT_REF_BAR; - | ^^^^^^^^^^^^^^ + = note: ...which requires const-evaluating + checking `::BAR`... + = note: ...which requires caching mir of `::BAR` for CTFE... note: ...which requires elaborating drops for `::BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:22 | LL | const BAR: u32 = TRAIT_REF_BAR; | ^^^^^^^^^^^^^ = note: ...which again requires simplifying constant for the type system `TRAIT_REF_BAR`, completing the cycle -note: cycle used when simplifying constant for the type system `TRAIT_REF_BAR` - --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1 - | -LL | const TRAIT_REF_BAR: u32 = ::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when simplifying constant for the type system `TRAIT_REF_BAR` + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr index 9b077a4d3effb..166bdc988f947 100644 --- a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr +++ b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr @@ -5,12 +5,8 @@ LL | trait Baz: Foo + Bar {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ...which immediately requires computing the super traits of `Baz` with associated type name `Item` again -note: cycle used when computing the super predicates of `Baz` - --> $DIR/ambiguous-associated-type2.rs:7:1 - | -LL | trait Baz: Foo + Bar {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when computing the super predicates of `Baz` + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr index 9ced743121001..b794a4ec01d4d 100644 --- a/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr +++ b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr @@ -10,7 +10,7 @@ note: cycle used when computing normalized predicates of `B` | LL | trait B: A {} | ^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-type-bounds/return-type-notation/impl-trait-in-trait.stderr b/tests/ui/associated-type-bounds/return-type-notation/impl-trait-in-trait.stderr index 0ed54415b9e04..9bd872f59afce 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/impl-trait-in-trait.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/impl-trait-in-trait.stderr @@ -4,23 +4,15 @@ error[E0391]: cycle detected when resolving lifetimes for `IntFactory::stream` LL | fn stream(self) -> impl IntFactory; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires computing function signature of `IntFactory::stream`... - --> $DIR/impl-trait-in-trait.rs:4:5 - | -LL | fn stream(self) -> impl IntFactory; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires looking up late bound vars inside `IntFactory::stream`... - --> $DIR/impl-trait-in-trait.rs:4:5 - | -LL | fn stream(self) -> impl IntFactory; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which requires computing function signature of `IntFactory::stream`... + = note: ...which requires looking up late bound vars inside `IntFactory::stream`... = note: ...which again requires resolving lifetimes for `IntFactory::stream`, completing the cycle note: cycle used when listing captured lifetimes for opaque `IntFactory::stream::{opaque#0}` --> $DIR/impl-trait-in-trait.rs:4:24 | LL | fn stream(self) -> impl IntFactory; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/impl-wf-cycle-4.stderr b/tests/ui/associated-types/impl-wf-cycle-4.stderr index fac06e64a3119..146133ddc458d 100644 --- a/tests/ui/associated-types/impl-wf-cycle-4.stderr +++ b/tests/ui/associated-types/impl-wf-cycle-4.stderr @@ -6,22 +6,10 @@ LL | | where LL | | T: Fn(Self::ToMatch), | |_________________________^ | -note: ...which requires computing normalized predicates of ``... - --> $DIR/impl-wf-cycle-4.rs:5:1 - | -LL | / impl Filter for T -LL | | where -LL | | T: Fn(Self::ToMatch), - | |_________________________^ + = note: ...which requires computing normalized predicates of ``... = note: ...which again requires computing whether `` has a guaranteed unsized self type, completing the cycle -note: cycle used when checking that `` is well-formed - --> $DIR/impl-wf-cycle-4.rs:5:1 - | -LL | / impl Filter for T -LL | | where -LL | | T: Fn(Self::ToMatch), - | |_________________________^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when checking that `` is well-formed + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-20825.stderr b/tests/ui/associated-types/issue-20825.stderr index e4f1fc62387c0..a833c5f69f906 100644 --- a/tests/ui/associated-types/issue-20825.stderr +++ b/tests/ui/associated-types/issue-20825.stderr @@ -5,12 +5,8 @@ LL | pub trait Processor: Subscriber { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ...which immediately requires computing the super traits of `Processor` with associated type name `Input` again -note: cycle used when computing the super predicates of `Processor` - --> $DIR/issue-20825.rs:5:1 - | -LL | pub trait Processor: Subscriber { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when computing the super predicates of `Processor` + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr b/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr index 3d4d19197baf4..5b6ce4e2eec89 100644 --- a/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr +++ b/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr @@ -5,12 +5,8 @@ LL | trait Trait { type Assoc; } | ^^^^^^^^^^^^^^ | = note: ...which immediately requires building specialization graph of trait `Trait` again -note: cycle used when coherence checking all impls of trait `Trait` - --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:8:1 - | -LL | trait Trait { type Assoc; } - | ^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when coherence checking all impls of trait `Trait` + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/generic_const_exprs/closures.stderr b/tests/ui/const-generics/generic_const_exprs/closures.stderr index e245a6dab25fa..9dd09586da589 100644 --- a/tests/ui/const-generics/generic_const_exprs/closures.stderr +++ b/tests/ui/const-generics/generic_const_exprs/closures.stderr @@ -4,23 +4,15 @@ error[E0391]: cycle detected when building an abstract representation for `test: LL | fn test() -> [u8; N + (|| 42)()] {} | ^^^^^^^^^^^^^ | -note: ...which requires building THIR for `test::{constant#0}`... - --> $DIR/closures.rs:3:35 - | -LL | fn test() -> [u8; N + (|| 42)()] {} - | ^^^^^^^^^^^^^ -note: ...which requires type-checking `test::{constant#0}`... - --> $DIR/closures.rs:3:35 - | -LL | fn test() -> [u8; N + (|| 42)()] {} - | ^^^^^^^^^^^^^ + = note: ...which requires building THIR for `test::{constant#0}`... + = note: ...which requires type-checking `test::{constant#0}`... = note: ...which again requires building an abstract representation for `test::{constant#0}`, completing the cycle note: cycle used when checking that `test` is well-formed --> $DIR/closures.rs:3:1 | LL | fn test() -> [u8; N + (|| 42)()] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/not_wf_param_in_rpitit.stderr b/tests/ui/const-generics/not_wf_param_in_rpitit.stderr index 3612cfad0d435..adea40e58f514 100644 --- a/tests/ui/const-generics/not_wf_param_in_rpitit.stderr +++ b/tests/ui/const-generics/not_wf_param_in_rpitit.stderr @@ -16,7 +16,7 @@ note: cycle used when checking that `Trait` is well-formed | LL | trait Trait { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 2 previous errors diff --git a/tests/ui/consts/const-size_of-cycle.stderr b/tests/ui/consts/const-size_of-cycle.stderr index 493cb1804fea2..e8970a2f34593 100644 --- a/tests/ui/consts/const-size_of-cycle.stderr +++ b/tests/ui/consts/const-size_of-cycle.stderr @@ -4,17 +4,12 @@ error[E0391]: cycle detected when evaluating type-level constant LL | bytes: [u8; std::mem::size_of::()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... - --> $DIR/const-size_of-cycle.rs:2:17 - | -LL | bytes: [u8; std::mem::size_of::()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... --> $SRC_DIR/core/src/mem/mod.rs:LL:COL note: ...which requires simplifying constant for the type system `core::mem::SizedTypeProperties::SIZE`... --> $SRC_DIR/core/src/mem/mod.rs:LL:COL -note: ...which requires const-evaluating + checking `core::mem::SizedTypeProperties::SIZE`... - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + = note: ...which requires const-evaluating + checking `core::mem::SizedTypeProperties::SIZE`... note: ...which requires computing layout of `Foo`... --> $DIR/const-size_of-cycle.rs:1:1 | @@ -27,12 +22,8 @@ note: ...which requires normalizing `[u8; std::mem::size_of::()]`... LL | bytes: [u8; std::mem::size_of::()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which again requires evaluating type-level constant, completing the cycle -note: cycle used when checking that `Foo` is well-formed - --> $DIR/const-size_of-cycle.rs:2:17 - | -LL | bytes: [u8; std::mem::size_of::()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when checking that `Foo` is well-formed + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-103790.stderr b/tests/ui/consts/issue-103790.stderr index e442c64e70ce1..97d1dd5a2b39c 100644 --- a/tests/ui/consts/issue-103790.stderr +++ b/tests/ui/consts/issue-103790.stderr @@ -34,7 +34,7 @@ note: cycle used when checking that `S` is well-formed | LL | struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 3 previous errors diff --git a/tests/ui/consts/issue-36163.stderr b/tests/ui/consts/issue-36163.stderr index 8a7a0981f4154..42d2e3abcf967 100644 --- a/tests/ui/consts/issue-36163.stderr +++ b/tests/ui/consts/issue-36163.stderr @@ -4,11 +4,7 @@ error[E0391]: cycle detected when simplifying constant for the type system `Foo: LL | B = A, | ^ | -note: ...which requires const-evaluating + checking `Foo::B::{constant#0}`... - --> $DIR/issue-36163.rs:4:9 - | -LL | B = A, - | ^ + = note: ...which requires const-evaluating + checking `Foo::B::{constant#0}`... note: ...which requires simplifying constant for the type system `A`... --> $DIR/issue-36163.rs:1:1 | @@ -25,7 +21,7 @@ note: cycle used when checking that `Foo` is well-formed | LL | enum Foo { | ^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-44415.stderr b/tests/ui/consts/issue-44415.stderr index e9170aeba6555..4fa46cf6f5a67 100644 --- a/tests/ui/consts/issue-44415.stderr +++ b/tests/ui/consts/issue-44415.stderr @@ -4,16 +4,8 @@ error[E0391]: cycle detected when evaluating type-level constant LL | bytes: [u8; unsafe { intrinsics::size_of::() }], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... - --> $DIR/issue-44415.rs:6:17 - | -LL | bytes: [u8; unsafe { intrinsics::size_of::() }], - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... - --> $DIR/issue-44415.rs:6:17 - | -LL | bytes: [u8; unsafe { intrinsics::size_of::() }], - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... + = note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... note: ...which requires computing layout of `Foo`... --> $DIR/issue-44415.rs:5:1 | @@ -26,12 +18,8 @@ note: ...which requires normalizing `[u8; unsafe { intrinsics::size_of::() LL | bytes: [u8; unsafe { intrinsics::size_of::() }], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which again requires evaluating type-level constant, completing the cycle -note: cycle used when checking that `Foo` is well-formed - --> $DIR/issue-44415.rs:6:17 - | -LL | bytes: [u8; unsafe { intrinsics::size_of::() }], - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when checking that `Foo` is well-formed + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/consts/recursive-const-stack-overflow.stderr b/tests/ui/consts/recursive-const-stack-overflow.stderr index 054102f0978ab..64351428a592f 100644 --- a/tests/ui/consts/recursive-const-stack-overflow.stderr +++ b/tests/ui/consts/recursive-const-stack-overflow.stderr @@ -4,18 +4,10 @@ error[E0391]: cycle detected when checking if `FOO` is a trivial const LL | const FOO: usize = FOO; | ^^^^^^^^^^^^^^^^ | -note: ...which requires building MIR for `FOO`... - --> $DIR/recursive-const-stack-overflow.rs:3:1 - | -LL | const FOO: usize = FOO; - | ^^^^^^^^^^^^^^^^ + = note: ...which requires building MIR for `FOO`... = note: ...which again requires checking if `FOO` is a trivial const, completing the cycle -note: cycle used when simplifying constant for the type system `FOO` - --> $DIR/recursive-const-stack-overflow.rs:3:1 - | -LL | const FOO: usize = FOO; - | ^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when simplifying constant for the type system `FOO` + = note: for more information, see and error[E0391]: cycle detected when checking if `main::BAR` is a trivial const --> $DIR/recursive-const-stack-overflow.rs:8:9 @@ -23,18 +15,10 @@ error[E0391]: cycle detected when checking if `main::BAR` is a trivial const LL | const BAR: usize = BAR; | ^^^^^^^^^^^^^^^^ | -note: ...which requires building MIR for `main::BAR`... - --> $DIR/recursive-const-stack-overflow.rs:8:9 - | -LL | const BAR: usize = BAR; - | ^^^^^^^^^^^^^^^^ + = note: ...which requires building MIR for `main::BAR`... = note: ...which again requires checking if `main::BAR` is a trivial const, completing the cycle -note: cycle used when simplifying constant for the type system `main::BAR` - --> $DIR/recursive-const-stack-overflow.rs:8:9 - | -LL | const BAR: usize = BAR; - | ^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: cycle used when simplifying constant for the type system `main::BAR` + = note: for more information, see and error: aborting due to 2 previous errors diff --git a/tests/ui/consts/recursive-zst-static.default.stderr b/tests/ui/consts/recursive-zst-static.default.stderr index 589ff44ccff1f..44a07cf3dc807 100644 --- a/tests/ui/consts/recursive-zst-static.default.stderr +++ b/tests/ui/consts/recursive-zst-static.default.stderr @@ -17,7 +17,7 @@ LL | static B: () = A; | ^^^^^^^^^^^^ = note: ...which again requires evaluating initializer of static `A`, completing the cycle = note: cycle used when running analysis passes on crate `recursive_zst_static` - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 2 previous errors diff --git a/tests/ui/consts/recursive-zst-static.unleash.stderr b/tests/ui/consts/recursive-zst-static.unleash.stderr index 589ff44ccff1f..44a07cf3dc807 100644 --- a/tests/ui/consts/recursive-zst-static.unleash.stderr +++ b/tests/ui/consts/recursive-zst-static.unleash.stderr @@ -17,7 +17,7 @@ LL | static B: () = A; | ^^^^^^^^^^^^ = note: ...which again requires evaluating initializer of static `A`, completing the cycle = note: cycle used when running analysis passes on crate `recursive_zst_static` - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 2 previous errors diff --git a/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr b/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr index c0b935567f814..833ce698af133 100644 --- a/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr +++ b/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr @@ -10,7 +10,7 @@ note: cycle used when checking that `Foo` is well-formed | LL | trait Foo> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr index 3e5579d2e4ab8..afb12aaad832c 100644 --- a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr +++ b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr @@ -10,7 +10,7 @@ note: cycle used when checking that `Chromosome` is well-formed | LL | trait Chromosome: Chromosome { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr index f2d8f07b04e5a..233961858d142 100644 --- a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr +++ b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr @@ -15,7 +15,7 @@ note: cycle used when computing the super predicates of `A` | LL | trait A: B { | ^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/cycle-trait/issue-12511.stderr b/tests/ui/cycle-trait/issue-12511.stderr index 45fc86a74131f..078f2eadc45a9 100644 --- a/tests/ui/cycle-trait/issue-12511.stderr +++ b/tests/ui/cycle-trait/issue-12511.stderr @@ -15,7 +15,7 @@ note: cycle used when checking that `T1` is well-formed | LL | trait T1 : T2 { | ^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + = note: for more information, see and error: aborting due to 1 previous error diff --git a/tests/ui/delegation/unsupported.current.stderr b/tests/ui/delegation/unsupported.current.stderr index 88938cd8b362c..fdfd9251b4650 100644 --- a/tests/ui/delegation/unsupported.current.stderr +++ b/tests/ui/delegation/unsupported.current.stderr @@ -4,18 +4,10 @@ error[E0391]: cycle detected when computing type of `opaque::