Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit bef91ee

Browse files
added links as a note
1 parent c429a72 commit bef91ee

File tree

51 files changed

+306
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+306
-56
lines changed

compiler/rustc_query_system/messages.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
query_system_cycle = cycle detected when {$stack_bottom}. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
query_system_cycle = cycle detected when {$stack_bottom}
2+
.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
23
34
query_system_cycle_recursive_trait_alias = trait aliases cannot be recursive
45

compiler/rustc_query_system/src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub struct CycleUsage {
4646
#[derive(Diagnostic)]
4747
#[diag(query_system_cycle, code = "E0391")]
4848
pub struct Cycle {
49+
#[note]
4950
#[primary_span]
5051
pub span: Span,
5152
pub stack_bottom: String,

tests/rustdoc-ui/issue-110629-private-type-cycle-dyn.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
error[E0391]: cycle detected when expanding type alias `Bar`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
error[E0391]: cycle detected when expanding type alias `Bar`
22
--> $DIR/issue-110629-private-type-cycle-dyn.rs:1:38
33
|
44
LL | type Bar<'a, 'b> = Box<dyn PartialEq<Bar<'a, 'b>>>;
55
| ^^^^^^^^^^^
66
|
7+
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
8+
--> $DIR/issue-110629-private-type-cycle-dyn.rs:1:38
9+
|
10+
LL | type Bar<'a, 'b> = Box<dyn PartialEq<Bar<'a, 'b>>>;
11+
| ^^^^^^^^^^^
712
= note: ...which immediately requires expanding type alias `Bar` again
813
= note: type aliases cannot be recursive
914
= help: consider using a struct, enum, or union instead to break the cycle

tests/ui/associated-consts/defaults-cyclic-fail.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `Tr::A`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
error[E0391]: cycle detected when const-evaluating + checking `Tr::A`
22
--> $DIR/defaults-cyclic-fail.rs:5:19
33
|
44
LL | const A: u8 = Self::B;
55
| ^^^^^^^
66
|
7+
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
8+
--> $DIR/defaults-cyclic-fail.rs:5:19
9+
|
10+
LL | const A: u8 = Self::B;
11+
| ^^^^^^^
712
note: ...which requires const-evaluating + checking `Tr::B`...
813
--> $DIR/defaults-cyclic-fail.rs:8:19
914
|

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`
22
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:22
33
|
44
LL | const BAR: u32 = IMPL_REF_BAR;
55
| ^^^^^^^^^^^^
66
|
7+
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
8+
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:22
9+
|
10+
LL | const BAR: u32 = IMPL_REF_BAR;
11+
| ^^^^^^^^^^^^
712
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
813
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
914
|

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
error[E0391]: cycle detected when elaborating drops for `FooDefault::BAR`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
error[E0391]: cycle detected when elaborating drops for `FooDefault::BAR`
22
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:22
33
|
44
LL | const BAR: u32 = DEFAULT_REF_BAR;
55
| ^^^^^^^^^^^^^^^
66
|
7+
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
8+
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:22
9+
|
10+
LL | const BAR: u32 = DEFAULT_REF_BAR;
11+
| ^^^^^^^^^^^^^^^
712
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
813
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
914
|

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`
22
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:22
33
|
44
LL | const BAR: u32 = TRAIT_REF_BAR;
55
| ^^^^^^^^^^^^^
66
|
7+
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
8+
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:22
9+
|
10+
LL | const BAR: u32 = TRAIT_REF_BAR;
11+
| ^^^^^^^^^^^^^
712
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
813
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
914
|

tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
error[E0391]: cycle detected when computing predicates of `Foo`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
error[E0391]: cycle detected when computing predicates of `Foo`
22
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
33
|
44
LL | struct Foo {
55
| ^^^^^^^^^^
66
|
7+
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
8+
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
9+
|
10+
LL | struct Foo {
11+
| ^^^^^^^^^^
712
note: ...which requires computing predicates of `Foo`...
813
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
914
|

tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
error[E0391]: cycle detected when computing predicates of `user`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information.
1+
error[E0391]: cycle detected when computing predicates of `user`
22
--> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
33
|
44
LL | fn user<T>() where S<T>::P: std::fmt::Debug {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7+
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
8+
--> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
9+
|
10+
LL | fn user<T>() where S<T>::P: std::fmt::Debug {}
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
712
note: ...which requires computing predicates of `user`...
813
--> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
914
|

tests/ui/associated-type-bounds/ambiguous-associated-type2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trait Bar<T> {
55
type Item;
66
}
77
trait Baz: Foo + Bar<Self::Item> {}
8-
//~^ ERROR cycle detected when computing the super traits of `Baz` with associated type name `Item`. see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information. [E0391]
8+
//~^ ERROR cycle detected when computing the super traits of `Baz` with associated type name `Item` [E0391]
99

1010

1111
fn main() {}

0 commit comments

Comments
 (0)