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

Commit b916ac6

Browse files
committed
adjust super_predicates_that_define_assoc_type query description
1 parent 6ab8fe2 commit b916ac6

File tree

8 files changed

+24
-19
lines changed

8 files changed

+24
-19
lines changed

compiler/rustc_middle/src/query/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,10 @@ rustc_queries! {
449449
/// full predicates are available (note that supertraits have
450450
/// additional acyclicity requirements).
451451
query super_predicates_that_define_assoc_type(key: (DefId, Option<rustc_span::symbol::Ident>)) -> ty::GenericPredicates<'tcx> {
452-
desc { |tcx| "computing the supertraits of `{}`", tcx.def_path_str(key.0) }
452+
desc { |tcx| "computing the super traits of `{}`{}",
453+
tcx.def_path_str(key.0),
454+
if let Some(assoc_name) = key.1 { format!(" with associated type name `{}`", assoc_name) } else { "".to_string() },
455+
}
453456
}
454457

455458
/// To avoid cycles within the predicates of a single item we compute
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
// ignore-tidy-linelength
2+
13
trait Foo {
24
type Item;
35
}
46
trait Bar<T> {
57
type Item;
68
}
79
trait Baz: Foo + Bar<Self::Item> {}
8-
//~^ ERROR cycle detected when computing the supertraits of `Baz` [E0391]
10+
//~^ ERROR cycle detected when computing the super traits of `Baz` with associated type name `Item` [E0391]
911

1012
fn main() {}

src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
error[E0391]: cycle detected when computing the supertraits of `Baz`
2-
--> $DIR/ambiguous-associated-type2.rs:7:1
1+
error[E0391]: cycle detected when computing the super traits of `Baz` with associated type name `Item`
2+
--> $DIR/ambiguous-associated-type2.rs:9:1
33
|
44
LL | trait Baz: Foo + Bar<Self::Item> {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: ...which again requires computing the supertraits of `Baz`, completing the cycle
8-
note: cycle used when computing the supertraits of `Baz`
9-
--> $DIR/ambiguous-associated-type2.rs:7:1
7+
= note: ...which again requires computing the super traits of `Baz` with associated type name `Item`, completing the cycle
8+
note: cycle used when computing the super traits of `Baz`
9+
--> $DIR/ambiguous-associated-type2.rs:9:1
1010
|
1111
LL | trait Baz: Foo + Bar<Self::Item> {}
1212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super predicates of `Chromosome`
44
LL | trait Chromosome: Chromosome {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires computing the supertraits of `Chromosome`...
7+
note: ...which requires computing the super traits of `Chromosome`...
88
--> $DIR/cycle-trait-supertrait-direct.rs:3:19
99
|
1010
LL | trait Chromosome: Chromosome {

src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super predicates of `B`
44
LL | trait B: C {
55
| ^^^^^^^^^^
66
|
7-
note: ...which requires computing the supertraits of `B`...
7+
note: ...which requires computing the super traits of `B`...
88
--> $DIR/cycle-trait-supertrait-indirect.rs:7:10
99
|
1010
LL | trait B: C {
@@ -14,13 +14,13 @@ note: ...which requires computing the super predicates of `C`...
1414
|
1515
LL | trait C: B { }
1616
| ^^^^^^^^^^
17-
note: ...which requires computing the supertraits of `C`...
17+
note: ...which requires computing the super traits of `C`...
1818
--> $DIR/cycle-trait-supertrait-indirect.rs:11:10
1919
|
2020
LL | trait C: B { }
2121
| ^
2222
= note: ...which again requires computing the super predicates of `B`, completing the cycle
23-
note: cycle used when computing the supertraits of `A`
23+
note: cycle used when computing the super traits of `A`
2424
--> $DIR/cycle-trait-supertrait-indirect.rs:4:10
2525
|
2626
LL | trait A: B {

src/test/ui/issues/issue-12511.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super predicates of `T1`
44
LL | trait T1 : T2 {
55
| ^^^^^^^^^^^^^
66
|
7-
note: ...which requires computing the supertraits of `T1`...
7+
note: ...which requires computing the super traits of `T1`...
88
--> $DIR/issue-12511.rs:1:12
99
|
1010
LL | trait T1 : T2 {
@@ -14,7 +14,7 @@ note: ...which requires computing the super predicates of `T2`...
1414
|
1515
LL | trait T2 : T1 {
1616
| ^^^^^^^^^^^^^
17-
note: ...which requires computing the supertraits of `T2`...
17+
note: ...which requires computing the super traits of `T2`...
1818
--> $DIR/issue-12511.rs:5:12
1919
|
2020
LL | trait T2 : T1 {

src/test/ui/issues/issue-20772.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
error[E0391]: cycle detected when computing the supertraits of `T`
1+
error[E0391]: cycle detected when computing the super traits of `T` with associated type name `Item`
22
--> $DIR/issue-20772.rs:1:1
33
|
44
LL | / trait T : Iterator<Item=Self::Item>
55
LL | |
66
LL | | {}
77
| |__^
88
|
9-
= note: ...which again requires computing the supertraits of `T`, completing the cycle
10-
note: cycle used when computing the supertraits of `T`
9+
= note: ...which again requires computing the super traits of `T` with associated type name `Item`, completing the cycle
10+
note: cycle used when computing the super traits of `T`
1111
--> $DIR/issue-20772.rs:1:1
1212
|
1313
LL | / trait T : Iterator<Item=Self::Item>

src/test/ui/issues/issue-20825.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0391]: cycle detected when computing the supertraits of `Processor`
1+
error[E0391]: cycle detected when computing the super traits of `Processor` with associated type name `Input`
22
--> $DIR/issue-20825.rs:5:1
33
|
44
LL | pub trait Processor: Subscriber<Input = Self::Input> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: ...which again requires computing the supertraits of `Processor`, completing the cycle
8-
note: cycle used when computing the supertraits of `Processor`
7+
= note: ...which again requires computing the super traits of `Processor` with associated type name `Input`, completing the cycle
8+
note: cycle used when computing the super traits of `Processor`
99
--> $DIR/issue-20825.rs:5:1
1010
|
1111
LL | pub trait Processor: Subscriber<Input = Self::Input> {

0 commit comments

Comments
 (0)