diff --git a/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs b/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs index c3c9f26c31571..0861742a01eae 100644 --- a/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs +++ b/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs @@ -116,6 +116,7 @@ fn annotation_level_for_level(level: Level) -> annotate_snippets::level::Level<' Level::Fatal | Level::Error => annotate_snippets::level::ERROR, Level::ForceWarning | Level::Warning => annotate_snippets::Level::WARNING, Level::Note | Level::OnceNote => annotate_snippets::Level::NOTE, + Level::BulletPoint => annotate_snippets::Level::NOTE.no_name(), Level::Help | Level::OnceHelp => annotate_snippets::Level::HELP, Level::FailureNote => annotate_snippets::Level::NOTE.no_name(), Level::Allow => panic!("Should not call with Allow"), @@ -123,6 +124,20 @@ fn annotation_level_for_level(level: Level) -> annotate_snippets::level::Level<' } } +fn message_level_for_level(level: Level) -> annotate_snippets::level::Level<'static> { + match level { + Level::BulletPoint => annotate_snippets::Level::NOTE.no_name(), + _ => annotation_level_for_level(level), + } +} + +fn format_message_for_level(level: Level, msg: Cow<'static, str>) -> Cow<'static, str> { + match level { + Level::BulletPoint => Cow::Owned(format!(" - {msg}")), + _ => msg, + } +} + impl AnnotateSnippetEmitter { pub fn new(dst: Destination) -> Self { Self { @@ -174,11 +189,26 @@ impl AnnotateSnippetEmitter { // If we don't have span information, emit and exit let Some(sm) = self.sm.as_ref() else { - group = group.elements(children.iter().map(|c| { - let msg = format_diag_messages(&c.messages, args).to_string(); - let level = annotation_level_for_level(c.level); - level.message(msg) - })); + for c in children { + let msg = format_message_for_level( + c.level, + Cow::Owned(format_diag_messages(&c.messages, args).to_string()), + ); + let annotation_level = annotation_level_for_level(c.level); + let message_level = message_level_for_level(c.level); + + if c.level == Level::BulletPoint + && !c.span.has_primary_spans() + && !c.span.has_span_labels() + { + report.push(std::mem::replace( + &mut group, + Group::with_title(annotation_level.secondary_title(msg)), + )); + } else { + group = group.element(message_level.message(msg)); + } + } report.push(group); if let Err(e) = emit_to_destination( @@ -239,7 +269,8 @@ impl AnnotateSnippetEmitter { } for c in children { - let level = annotation_level_for_level(c.level); + let annotation_level = annotation_level_for_level(c.level); + let message_level = message_level_for_level(c.level); // If at least one portion of the message is styled, we need to // "pre-style" the message @@ -248,16 +279,24 @@ impl AnnotateSnippetEmitter { } else { format_diag_messages(&c.messages, args) }; + let msg = format_message_for_level(c.level, msg); // This is a secondary message with no span info if !c.span.has_primary_spans() && !c.span.has_span_labels() { - group = group.element(level.clone().message(msg)); + if c.level == Level::BulletPoint { + report.push(std::mem::replace( + &mut group, + Group::with_title(annotation_level.secondary_title(msg)), + )); + } else { + group = group.element(message_level.message(msg)); + } continue; } report.push(std::mem::replace( &mut group, - Group::with_title(level.clone().secondary_title(msg)), + Group::with_title(annotation_level.clone().secondary_title(msg)), )); let mut file_ann = collect_annotations(args, &c.span, sm); @@ -286,7 +325,7 @@ impl AnnotateSnippetEmitter { file_idx, &mut report, group, - &level, + &annotation_level, ); } } diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 9525a45d55f1b..3bb9254137bcb 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -297,6 +297,7 @@ impl DiagInner { Level::ForceWarning | Level::Warning | Level::Note + | Level::BulletPoint | Level::OnceNote | Level::Help | Level::OnceHelp @@ -688,6 +689,20 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> { self } + with_fn! { with_bullet_point, + /// Add a bullet point to this diagnostic. + pub fn bullet_point(&mut self, msg: impl Into) -> &mut Self { + self.sub(Level::BulletPoint, msg, MultiSpan::new()); + self + } } + + with_fn! { with_span_bullet_point, + /// Add a bullet point to this diagnostic. + pub fn span_bullet_point(&mut self, sp: impl Into, msg: impl Into) -> &mut Self { + self.sub(Level::BulletPoint, msg, sp.into()); + self + } } + pub fn highlighted_span_note( &mut self, span: impl Into, diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index d17a4d6de42f5..0848eca0e056d 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -600,8 +600,8 @@ impl<'a> DiagCtxtHandle<'a> { DelayedBug => { return self.inner.borrow_mut().emit_diagnostic(diag, self.tainted_with_errors); } - ForceWarning | Warning | Note | OnceNote | Help | OnceHelp | FailureNote | Allow - | Expect => None, + ForceWarning | Warning | Note | BulletPoint | OnceNote | Help | OnceHelp + | FailureNote | Allow | Expect => None, }; // FIXME(Centril, #69537): Consider reintroducing panic on overwriting a stashed diagnostic @@ -1261,7 +1261,7 @@ impl DiagCtxtInner { return None; } } - Note | Help | FailureNote => {} + Note | BulletPoint | Help | FailureNote => {} OnceNote | OnceHelp => panic!("bad level: {:?}", diagnostic.level), Allow => { // Nothing emitted for allowed lints. @@ -1531,6 +1531,7 @@ impl DelayedDiagInner { /// | ForceWarning | - | () | yes | - | lint-only /// | Warning | - | () | yes | yes | yes /// | Note | - | () | rare | yes | - +/// | BulletPoint | - | () | - | yes | - /// | OnceNote | - | () | - | yes | lint-only /// | Help | - | () | rare | yes | - /// | OnceHelp | - | () | - | yes | lint-only @@ -1574,6 +1575,9 @@ pub enum Level { /// A message giving additional context. Note, + /// A message rendered as a bullet point. + BulletPoint, + /// A note that is only emitted once. OnceNote, @@ -1611,7 +1615,7 @@ impl Level { AnsiColor::Yellow.on_default() } } - Note | OnceNote => AnsiColor::BrightGreen.on_default(), + Note | BulletPoint | OnceNote => AnsiColor::BrightGreen.on_default(), Help | OnceHelp => AnsiColor::BrightCyan.on_default(), FailureNote => anstyle::Style::new(), Allow | Expect => unreachable!(), @@ -1624,6 +1628,7 @@ impl Level { Fatal | Error => "error", ForceWarning | Warning => "warning", Note | OnceNote => "note", + BulletPoint => "bullet-point", Help | OnceHelp => "help", FailureNote => "failure-note", Allow | Expect => unreachable!(), diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs b/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs index e335037f2c4c9..31e2fb71d30ba 100644 --- a/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs +++ b/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs @@ -237,6 +237,7 @@ impl DiagnosticDeriveVariantBuilder { let fn_ident = format_ident!("{}", subdiag); match subdiag { SubdiagnosticKind::Note + | SubdiagnosticKind::BulletPoint | SubdiagnosticKind::NoteOnce | SubdiagnosticKind::Help | SubdiagnosticKind::HelpOnce @@ -362,6 +363,7 @@ impl DiagnosticDeriveVariantBuilder { Ok(self.add_spanned_subdiagnostic(binding, &fn_ident, message, variant)) } SubdiagnosticKind::Note + | SubdiagnosticKind::BulletPoint | SubdiagnosticKind::NoteOnce | SubdiagnosticKind::Help | SubdiagnosticKind::HelpOnce diff --git a/compiler/rustc_macros/src/diagnostics/utils.rs b/compiler/rustc_macros/src/diagnostics/utils.rs index 55a8445744cba..aac0e1b8f2225 100644 --- a/compiler/rustc_macros/src/diagnostics/utils.rs +++ b/compiler/rustc_macros/src/diagnostics/utils.rs @@ -560,6 +560,8 @@ pub(super) enum SubdiagnosticKind { Label, /// `#[note(...)]` Note, + /// `#[bullet_point(...)]` + BulletPoint, /// `#[note_once(...)]` NoteOnce, /// `#[help(...)]` @@ -612,6 +614,7 @@ impl SubdiagnosticVariant { let mut kind = match name { "label" => SubdiagnosticKind::Label, "note" => SubdiagnosticKind::Note, + "bullet_point" => SubdiagnosticKind::BulletPoint, "note_once" => SubdiagnosticKind::NoteOnce, "help" => SubdiagnosticKind::Help, "help_once" => SubdiagnosticKind::HelpOnce, @@ -672,6 +675,7 @@ impl SubdiagnosticVariant { match kind { SubdiagnosticKind::Label | SubdiagnosticKind::Note + | SubdiagnosticKind::BulletPoint | SubdiagnosticKind::NoteOnce | SubdiagnosticKind::Help | SubdiagnosticKind::HelpOnce @@ -819,6 +823,7 @@ impl SubdiagnosticVariant { } SubdiagnosticKind::Label | SubdiagnosticKind::Note + | SubdiagnosticKind::BulletPoint | SubdiagnosticKind::NoteOnce | SubdiagnosticKind::Help | SubdiagnosticKind::HelpOnce @@ -834,6 +839,7 @@ impl quote::IdentFragment for SubdiagnosticKind { match self { SubdiagnosticKind::Label => write!(f, "label"), SubdiagnosticKind::Note => write!(f, "note"), + SubdiagnosticKind::BulletPoint => write!(f, "bullet_point"), SubdiagnosticKind::NoteOnce => write!(f, "note_once"), SubdiagnosticKind::Help => write!(f, "help"), SubdiagnosticKind::HelpOnce => write!(f, "help_once"), diff --git a/compiler/rustc_macros/src/lib.rs b/compiler/rustc_macros/src/lib.rs index 44969908b3f41..635503a55b78b 100644 --- a/compiler/rustc_macros/src/lib.rs +++ b/compiler/rustc_macros/src/lib.rs @@ -184,6 +184,7 @@ decl_derive!( help, help_once, note, + bullet_point, note_once, warning, // field attributes @@ -203,6 +204,7 @@ decl_derive!( help, help_once, note, + bullet_point, note_once, warning, subdiagnostic, diff --git a/compiler/rustc_query_impl/src/error.rs b/compiler/rustc_query_impl/src/error.rs index 44d53f87aae29..b5783b839106b 100644 --- a/compiler/rustc_query_impl/src/error.rs +++ b/compiler/rustc_query_impl/src/error.rs @@ -25,7 +25,7 @@ pub(crate) struct QueryOverflowNote { } #[derive(Subdiagnostic)] -#[note("...which requires {$desc}...")] +#[bullet_point("which requires {$desc}...")] pub(crate) struct CycleStack { #[primary_span] pub span: Span, @@ -34,9 +34,9 @@ pub(crate) struct CycleStack { #[derive(Subdiagnostic)] pub(crate) enum StackCount { - #[note("...which immediately requires {$stack_bottom} again")] + #[bullet_point("which immediately requires {$stack_bottom} again")] Single { stack_bottom: String }, - #[note("...which again requires {$stack_bottom}, completing the cycle")] + #[bullet_point("which again requires {$stack_bottom}, completing the cycle")] Multiple { stack_bottom: String }, } diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs index 9fa26305f6b0b..519203d378e5b 100644 --- a/src/tools/compiletest/src/errors.rs +++ b/src/tools/compiletest/src/errors.rs @@ -25,7 +25,7 @@ impl ErrorKind { match s { "help" => ErrorKind::Help, "error" | "error: internal compiler error" => ErrorKind::Error, - "note" | "failure-note" => ErrorKind::Note, + "note" | "failure-note" | "bullet-point" => ErrorKind::Note, "warning" => ErrorKind::Warning, _ => panic!("unexpected compiler diagnostic kind `{s}`"), } diff --git a/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr b/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr index 6ee7e4b781c5b..274a91e5a7847 100644 --- a/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr +++ b/tests/rustdoc-ui/private-type-cycle-dyn-110629.stderr @@ -4,7 +4,8 @@ error[E0391]: cycle detected when expanding type alias `Bar` LL | type Bar<'a, 'b> = Box>>; | ^^^^^^^^^^^ | - = note: ...which immediately requires expanding type alias `Bar` again + - which immediately requires expanding type alias `Bar` again + | = note: type aliases cannot be recursive = help: consider using a struct, enum, or union instead to break the cycle = help: see for more information diff --git a/tests/ui/associated-consts/defaults-cyclic-fail.stderr b/tests/ui/associated-consts/defaults-cyclic-fail.stderr index 31974d955611f..ee1142f8b349e 100644 --- a/tests/ui/associated-consts/defaults-cyclic-fail.stderr +++ b/tests/ui/associated-consts/defaults-cyclic-fail.stderr @@ -4,22 +4,22 @@ error[E0391]: cycle detected when simplifying constant for the type system `Tr:: LL | const A: u8 = Self::B; | ^^^^^^^^^^^ | -note: ...which requires const-evaluating + checking `Tr::A`... + - which requires const-evaluating + checking `Tr::A`... --> $DIR/defaults-cyclic-fail.rs:5:19 | LL | const A: u8 = Self::B; | ^^^^^^^ -note: ...which requires simplifying constant for the type system `Tr::B`... + - which requires simplifying constant for the type system `Tr::B`... --> $DIR/defaults-cyclic-fail.rs:8:5 | LL | const B: u8 = Self::A; | ^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `Tr::B`... + - which requires const-evaluating + checking `Tr::B`... --> $DIR/defaults-cyclic-fail.rs:8:19 | LL | const B: u8 = Self::A; | ^^^^^^^ - = note: ...which again requires simplifying constant for the type system `Tr::A`, completing the cycle + - which again requires simplifying constant for the type system `Tr::A`, completing the cycle note: cycle used when optimizing promoted MIR for `main` --> $DIR/defaults-cyclic-fail.rs:16:16 | 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..9b51421c0fe5b 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,22 +4,22 @@ 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`... + - 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 checking if `::BAR` is a trivial const... + - 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`... + - 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 again requires checking if `IMPL_REF_BAR` is a trivial const, completing the cycle + - 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 | 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..6a248e9c0720d 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 @@ -4,32 +4,32 @@ error[E0391]: cycle detected when caching mir of `FooDefault::BAR` for CTFE LL | const BAR: u32 = DEFAULT_REF_BAR; | ^^^^^^^^^^^^^^ | -note: ...which requires elaborating drops for `FooDefault::BAR`... + - which requires elaborating drops for `FooDefault::BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:22 | LL | const BAR: u32 = DEFAULT_REF_BAR; | ^^^^^^^^^^^^^^^ -note: ...which requires simplifying constant for the type system `DEFAULT_REF_BAR`... + - which requires simplifying constant for the type system `DEFAULT_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1 | LL | const DEFAULT_REF_BAR: u32 = ::BAR; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`... + - which requires const-evaluating + checking `DEFAULT_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:30 | LL | const DEFAULT_REF_BAR: u32 = ::BAR; | ^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires simplifying constant for the type system `FooDefault::BAR`... + - which requires simplifying constant for the type system `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`... + - 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 again requires caching mir of `FooDefault::BAR` for CTFE, completing the cycle + - 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 | 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 8197cfcba5025..c72a0dead2c7f 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 @@ -4,32 +4,33 @@ error[E0391]: cycle detected when simplifying constant for the type system `TRAI LL | const TRAIT_REF_BAR: u32 = ::BAR; | ^^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`... + - which requires const-evaluating + checking `TRAIT_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:28 | LL | const TRAIT_REF_BAR: u32 = ::BAR; | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires simplifying constant for the type system `::BAR`... + - 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 const-evaluating + checking `::BAR`... + - which requires const-evaluating + checking `::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... + - 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 elaborating drops for `::BAR`... + - 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 + - which again requires simplifying constant for the type system `TRAIT_REF_BAR`, completing the cycle + | = note: cycle used when running analysis passes on crate `issue_24949_assoc_const_static_recursion_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 diff --git a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr index 9b077a4d3effb..31f2a327d93d9 100644 --- a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr +++ b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super traits of `Baz` with assoc LL | trait Baz: Foo + Bar {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: ...which immediately requires computing the super traits of `Baz` with associated type name `Item` again + - 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 | diff --git a/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr index 9ced743121001..1cd537cc897d5 100644 --- a/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr +++ b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the implied predicates of `B` LL | trait B: A {} | ^ | - = note: ...which immediately requires computing the implied predicates of `B` again + - which immediately requires computing the implied predicates of `B` again note: cycle used when computing normalized predicates of `B` --> $DIR/implied-bounds-cycle.rs:5:1 | 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..0d9e55e0493fc 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,17 +4,17 @@ 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`... + - 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`... + - 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 again requires resolving lifetimes for `IntFactory::stream`, completing the cycle + - 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 | diff --git a/tests/ui/associated-types/impl-wf-cycle-4.stderr b/tests/ui/associated-types/impl-wf-cycle-4.stderr index fac06e64a3119..fff20e6b7e8f8 100644 --- a/tests/ui/associated-types/impl-wf-cycle-4.stderr +++ b/tests/ui/associated-types/impl-wf-cycle-4.stderr @@ -6,14 +6,14 @@ LL | | where LL | | T: Fn(Self::ToMatch), | |_________________________^ | -note: ...which requires computing normalized predicates of ``... + - 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 again requires computing whether `` has a guaranteed unsized self type, completing the cycle + - 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 | diff --git a/tests/ui/associated-types/issue-20825.stderr b/tests/ui/associated-types/issue-20825.stderr index e4f1fc62387c0..8cf0d838c6d38 100644 --- a/tests/ui/associated-types/issue-20825.stderr +++ b/tests/ui/associated-types/issue-20825.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super traits of `Processor` with LL | pub trait Processor: Subscriber { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: ...which immediately requires computing the super traits of `Processor` with associated type name `Input` again + - 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 | 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..28e24a0843d1b 100644 --- a/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr +++ b/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when building specialization graph of trait `Trait` LL | trait Trait { type Assoc; } | ^^^^^^^^^^^^^^ | - = note: ...which immediately requires building specialization graph of trait `Trait` again + - 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 | diff --git a/tests/ui/const-generics/generic_const_exprs/closures.stderr b/tests/ui/const-generics/generic_const_exprs/closures.stderr index e245a6dab25fa..da5391dbddd00 100644 --- a/tests/ui/const-generics/generic_const_exprs/closures.stderr +++ b/tests/ui/const-generics/generic_const_exprs/closures.stderr @@ -4,17 +4,17 @@ 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}`... + - 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}`... + - which requires type-checking `test::{constant#0}`... --> $DIR/closures.rs:3:35 | LL | fn test() -> [u8; N + (|| 42)()] {} | ^^^^^^^^^^^^^ - = note: ...which again requires building an abstract representation for `test::{constant#0}`, completing the cycle + - 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 | 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..09e433911e9c4 100644 --- a/tests/ui/const-generics/not_wf_param_in_rpitit.stderr +++ b/tests/ui/const-generics/not_wf_param_in_rpitit.stderr @@ -10,7 +10,7 @@ error[E0391]: cycle detected when computing type of `Trait::N` LL | trait Trait { | ^^^^^ | - = note: ...which immediately requires computing type of `Trait::N` again + - which immediately requires computing type of `Trait::N` again note: cycle used when checking that `Trait` is well-formed --> $DIR/not_wf_param_in_rpitit.rs:3:1 | diff --git a/tests/ui/consts/const-size_of-cycle.stderr b/tests/ui/consts/const-size_of-cycle.stderr index 01aa5e726b451..089f6603104b6 100644 --- a/tests/ui/consts/const-size_of-cycle.stderr +++ b/tests/ui/consts/const-size_of-cycle.stderr @@ -4,20 +4,20 @@ 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}`... + - 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`... + - 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`... + - which requires const-evaluating + checking `core::mem::SizedTypeProperties::SIZE`... --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - = note: ...which requires computing layout of `Foo`... - = note: ...which requires computing layout of `[u8; std::mem::size_of::()]`... -note: ...which requires normalizing `[u8; std::mem::size_of::()]`... + - which requires computing layout of `Foo`... + - which requires computing layout of `[u8; std::mem::size_of::()]`... + - which requires normalizing `[u8; std::mem::size_of::()]`... --> $DIR/const-size_of-cycle.rs:2:17 | LL | bytes: [u8; std::mem::size_of::()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which again requires evaluating type-level constant, completing the cycle + - 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 | diff --git a/tests/ui/consts/issue-103790.stderr b/tests/ui/consts/issue-103790.stderr index e442c64e70ce1..0b294f06c1275 100644 --- a/tests/ui/consts/issue-103790.stderr +++ b/tests/ui/consts/issue-103790.stderr @@ -28,7 +28,7 @@ error[E0391]: cycle detected when computing type of `S::S` LL | struct S; | ^ | - = note: ...which immediately requires computing type of `S::S` again + - which immediately requires computing type of `S::S` again note: cycle used when checking that `S` is well-formed --> $DIR/issue-103790.rs:4:1 | diff --git a/tests/ui/consts/issue-36163.stderr b/tests/ui/consts/issue-36163.stderr index 8a7a0981f4154..9f17247d24aa0 100644 --- a/tests/ui/consts/issue-36163.stderr +++ b/tests/ui/consts/issue-36163.stderr @@ -4,22 +4,22 @@ 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}`... + - which requires const-evaluating + checking `Foo::B::{constant#0}`... --> $DIR/issue-36163.rs:4:9 | LL | B = A, | ^ -note: ...which requires simplifying constant for the type system `A`... + - which requires simplifying constant for the type system `A`... --> $DIR/issue-36163.rs:1:1 | LL | const A: isize = Foo::B as isize; | ^^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `A`... + - which requires const-evaluating + checking `A`... --> $DIR/issue-36163.rs:1:18 | LL | const A: isize = Foo::B as isize; | ^^^^^^^^^^^^^^^ - = note: ...which again requires simplifying constant for the type system `Foo::B::{constant#0}`, completing the cycle + - which again requires simplifying constant for the type system `Foo::B::{constant#0}`, completing the cycle note: cycle used when checking that `Foo` is well-formed --> $DIR/issue-36163.rs:3:1 | diff --git a/tests/ui/consts/issue-44415.stderr b/tests/ui/consts/issue-44415.stderr index 0e3f2e6199f76..f649ac47a3264 100644 --- a/tests/ui/consts/issue-44415.stderr +++ b/tests/ui/consts/issue-44415.stderr @@ -4,19 +4,19 @@ 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}`... + - 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 computing layout of `Foo`... - = note: ...which requires computing layout of `[u8; unsafe { intrinsics::size_of::() }]`... -note: ...which requires normalizing `[u8; unsafe { intrinsics::size_of::() }]`... + - which requires computing layout of `Foo`... + - which requires computing layout of `[u8; unsafe { intrinsics::size_of::() }]`... + - which requires normalizing `[u8; unsafe { intrinsics::size_of::() }]`... --> $DIR/issue-44415.rs:6:17 | LL | bytes: [u8; unsafe { intrinsics::size_of::() }], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which again requires evaluating type-level constant, completing the cycle + - 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 | diff --git a/tests/ui/consts/recursive-zst-static.default.stderr b/tests/ui/consts/recursive-zst-static.default.stderr index 589ff44ccff1f..1f895a27af375 100644 --- a/tests/ui/consts/recursive-zst-static.default.stderr +++ b/tests/ui/consts/recursive-zst-static.default.stderr @@ -10,12 +10,13 @@ error[E0391]: cycle detected when evaluating initializer of static `A` LL | static A: () = B; | ^^^^^^^^^^^^ | -note: ...which requires evaluating initializer of static `B`... + - which requires evaluating initializer of static `B`... --> $DIR/recursive-zst-static.rs:14:1 | LL | static B: () = A; | ^^^^^^^^^^^^ - = note: ...which again requires evaluating initializer of static `A`, completing the cycle + - 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 diff --git a/tests/ui/consts/recursive-zst-static.unleash.stderr b/tests/ui/consts/recursive-zst-static.unleash.stderr index 589ff44ccff1f..1f895a27af375 100644 --- a/tests/ui/consts/recursive-zst-static.unleash.stderr +++ b/tests/ui/consts/recursive-zst-static.unleash.stderr @@ -10,12 +10,13 @@ error[E0391]: cycle detected when evaluating initializer of static `A` LL | static A: () = B; | ^^^^^^^^^^^^ | -note: ...which requires evaluating initializer of static `B`... + - which requires evaluating initializer of static `B`... --> $DIR/recursive-zst-static.rs:14:1 | LL | static B: () = A; | ^^^^^^^^^^^^ - = note: ...which again requires evaluating initializer of static `A`, completing the cycle + - 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 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..50bcb5ed0fd24 100644 --- a/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr +++ b/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing type of `Foo::X` LL | trait Foo> { | ^^^ | - = note: ...which immediately requires computing type of `Foo::X` again + - which immediately requires computing type of `Foo::X` again note: cycle used when checking that `Foo` is well-formed --> $DIR/cycle-trait-default-type-trait.rs:4:1 | diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr index 3e5579d2e4ab8..8ff00a61169e6 100644 --- a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr +++ b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super predicates of `Chromosome` LL | trait Chromosome: Chromosome { | ^^^^^^^^^^ | - = note: ...which immediately requires computing the super predicates of `Chromosome` again + - which immediately requires computing the super predicates of `Chromosome` again note: cycle used when checking that `Chromosome` is well-formed --> $DIR/cycle-trait-supertrait-direct.rs:3:1 | diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr index f2d8f07b04e5a..a64e8e522d4c7 100644 --- a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr +++ b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr @@ -4,12 +4,12 @@ error[E0391]: cycle detected when computing the super predicates of `B` LL | trait B: C { | ^ | -note: ...which requires computing the super predicates of `C`... + - which requires computing the super predicates of `C`... --> $DIR/cycle-trait-supertrait-indirect.rs:11:10 | LL | trait C: B { } | ^ - = note: ...which again requires computing the super predicates of `B`, completing the cycle + - which again requires computing the super predicates of `B`, completing the cycle note: cycle used when computing the super predicates of `A` --> $DIR/cycle-trait-supertrait-indirect.rs:4:10 | diff --git a/tests/ui/cycle-trait/issue-12511.stderr b/tests/ui/cycle-trait/issue-12511.stderr index 45fc86a74131f..8695efad39b5b 100644 --- a/tests/ui/cycle-trait/issue-12511.stderr +++ b/tests/ui/cycle-trait/issue-12511.stderr @@ -4,12 +4,12 @@ error[E0391]: cycle detected when computing the super predicates of `T1` LL | trait T1 : T2 { | ^^ | -note: ...which requires computing the super predicates of `T2`... + - which requires computing the super predicates of `T2`... --> $DIR/issue-12511.rs:5:12 | LL | trait T2 : T1 { | ^^ - = note: ...which again requires computing the super predicates of `T1`, completing the cycle + - which again requires computing the super predicates of `T1`, completing the cycle note: cycle used when checking that `T1` is well-formed --> $DIR/issue-12511.rs:1:1 | diff --git a/tests/ui/delegation/unsupported.current.stderr b/tests/ui/delegation/unsupported.current.stderr index 657f990271734..7b88124c17243 100644 --- a/tests/ui/delegation/unsupported.current.stderr +++ b/tests/ui/delegation/unsupported.current.stderr @@ -4,12 +4,12 @@ error[E0391]: cycle detected when computing type of `opaque::