Skip to content

Commit a54a668

Browse files
moved note as unspanned note, moved note to the bottom of the msg
1 parent e6e8892 commit a54a668

File tree

47 files changed

+54
-244
lines changed

Some content is hidden

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

47 files changed

+54
-244
lines changed

compiler/rustc_query_system/src/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ pub struct CycleUsage {
4646
#[derive(Diagnostic)]
4747
#[diag(query_system_cycle, code = "E0391")]
4848
pub struct Cycle {
49-
#[note]
5049
#[primary_span]
5150
pub span: Span,
5251
pub stack_bottom: String,
@@ -58,6 +57,8 @@ pub struct Cycle {
5857
pub alias: Option<Alias>,
5958
#[subdiagnostic]
6059
pub cycle_usage: Option<CycleUsage>,
60+
#[note]
61+
pub note_span: (),
6162
}
6263

6364
#[derive(Diagnostic)]

compiler/rustc_query_system/src/query/job.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ pub(crate) fn report_cycle<'a, D: DepKind>(
607607
alias,
608608
cycle_usage: cycle_usage,
609609
stack_count,
610+
note_span: (),
610611
};
611612

612613
cycle_diag.into_diagnostic(&sess.parse_sess.span_diagnostic)

src/tools/miri/tests/fail/layout_cycle.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0391]: cycle detected when computing layout of `S<S<()>>`
22
|
3-
= 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
43
= note: ...which requires computing layout of `<S<()> as Tr>::I`...
54
= note: ...which again requires computing layout of `S<S<()>>`, completing the cycle
5+
= 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
66

77
error: post-monomorphization error: a cycle occurred during layout computation
88
--> RUSTLIB/core/src/mem/mod.rs:LL:CC

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when const-evaluating + checking `Tr::A`
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-
| ^^^^^^^
127
note: ...which requires const-evaluating + checking `Tr::B`...
138
--> $DIR/defaults-cyclic-fail.rs:8:19
149
|
@@ -20,6 +15,7 @@ note: cycle used when const-evaluating + checking `main::promoted[1]`
2015
|
2116
LL | assert_eq!(<() as Tr>::A, 0);
2217
| ^^^^^^^^^^^^^
18+
= 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
2319

2420
error: aborting due to previous error
2521

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-249
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-
| ^^^^^^^^^^^^
127
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
138
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
149
|
@@ -31,6 +26,7 @@ LL | const BAR: u32 = IMPL_REF_BAR;
3126
| ^^^^^^^^^^^^^^
3227
= note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`, completing the cycle
3328
= note: cycle used when running analysis passes on this crate
29+
= 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
3430

3531
error: aborting due to previous error
3632

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when elaborating drops for `FooDefault::BAR`
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-
| ^^^^^^^^^^^^^^^
127
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
138
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
149
|
@@ -31,6 +26,7 @@ LL | const BAR: u32 = DEFAULT_REF_BAR;
3126
| ^^^^^^^^^^^^^^
3227
= note: ...which again requires elaborating drops for `FooDefault::BAR`, completing the cycle
3328
= note: cycle used when running analysis passes on this crate
29+
= 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
3430

3531
error: aborting due to previous error
3632

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-249
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-
| ^^^^^^^^^^^^^
127
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
138
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
149
|
@@ -31,6 +26,7 @@ LL | const BAR: u32 = TRAIT_REF_BAR;
3126
| ^^^^^^^^^^^^^^
3227
= note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`, completing the cycle
3328
= note: cycle used when running analysis passes on this crate
29+
= 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
3430

3531
error: aborting due to previous error
3632

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when computing predicates of `Foo`
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-
| ^^^^^^^^^^
127
note: ...which requires computing predicates of `Foo`...
138
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
149
|
@@ -42,6 +37,7 @@ LL | |
4237
LL | |
4338
LL | | fn main() {}
4439
| |____________^
40+
= 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
4541

4642
error: aborting due to previous error
4743

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when computing predicates of `user`
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-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127
note: ...which requires computing predicates of `user`...
138
--> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
149
|
@@ -36,6 +31,7 @@ LL | | // FIXME(inherent_associated_types): This shouldn't lead to a cycle error
3631
LL | |
3732
LL | | fn main() {}
3833
| |____________^
34+
= 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
3935

4036
error: aborting due to previous error
4137

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ error[E0391]: cycle detected when computing the super traits of `Baz` with assoc
44
LL | trait Baz: Foo + Bar<Self::Item> {}
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/ambiguous-associated-type2.rs:7:1
9-
|
10-
LL | trait Baz: Foo + Bar<Self::Item> {}
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127
= note: ...which immediately requires computing the super traits of `Baz` with associated type name `Item` again
138
note: cycle used when computing the super predicates of `Baz`
149
--> $DIR/ambiguous-associated-type2.rs:7:1
1510
|
1611
LL | trait Baz: Foo + Bar<Self::Item> {}
1712
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13+
= 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
1814

1915
error: aborting due to previous error
2016

0 commit comments

Comments
 (0)