adjust super_predicates_that_define_assoc_type query description
This commit is contained in:
parent
6ab8fe223e
commit
b916ac6322
8 changed files with 24 additions and 19 deletions
|
@ -449,7 +449,10 @@ rustc_queries! {
|
||||||
/// full predicates are available (note that supertraits have
|
/// full predicates are available (note that supertraits have
|
||||||
/// additional acyclicity requirements).
|
/// additional acyclicity requirements).
|
||||||
query super_predicates_that_define_assoc_type(key: (DefId, Option<rustc_span::symbol::Ident>)) -> ty::GenericPredicates<'tcx> {
|
query super_predicates_that_define_assoc_type(key: (DefId, Option<rustc_span::symbol::Ident>)) -> ty::GenericPredicates<'tcx> {
|
||||||
desc { |tcx| "computing the supertraits of `{}`", tcx.def_path_str(key.0) }
|
desc { |tcx| "computing the super traits of `{}`{}",
|
||||||
|
tcx.def_path_str(key.0),
|
||||||
|
if let Some(assoc_name) = key.1 { format!(" with associated type name `{}`", assoc_name) } else { "".to_string() },
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// To avoid cycles within the predicates of a single item we compute
|
/// To avoid cycles within the predicates of a single item we compute
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
trait Foo {
|
trait Foo {
|
||||||
type Item;
|
type Item;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +7,6 @@ trait Bar<T> {
|
||||||
type Item;
|
type Item;
|
||||||
}
|
}
|
||||||
trait Baz: Foo + Bar<Self::Item> {}
|
trait Baz: Foo + Bar<Self::Item> {}
|
||||||
//~^ ERROR cycle detected when computing the supertraits of `Baz` [E0391]
|
//~^ ERROR cycle detected when computing the super traits of `Baz` with associated type name `Item` [E0391]
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
error[E0391]: cycle detected when computing the supertraits of `Baz`
|
error[E0391]: cycle detected when computing the super traits of `Baz` with associated type name `Item`
|
||||||
--> $DIR/ambiguous-associated-type2.rs:7:1
|
--> $DIR/ambiguous-associated-type2.rs:9:1
|
||||||
|
|
|
|
||||||
LL | trait Baz: Foo + Bar<Self::Item> {}
|
LL | trait Baz: Foo + Bar<Self::Item> {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: ...which again requires computing the supertraits of `Baz`, completing the cycle
|
= note: ...which again requires computing the super traits of `Baz` with associated type name `Item`, completing the cycle
|
||||||
note: cycle used when computing the super traits of `Baz`
|
note: cycle used when computing the super traits of `Baz`
|
||||||
--> $DIR/ambiguous-associated-type2.rs:7:1
|
--> $DIR/ambiguous-associated-type2.rs:9:1
|
||||||
|
|
|
|
||||||
LL | trait Baz: Foo + Bar<Self::Item> {}
|
LL | trait Baz: Foo + Bar<Self::Item> {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error[E0391]: cycle detected when computing the supertraits of `T`
|
error[E0391]: cycle detected when computing the super traits of `T` with associated type name `Item`
|
||||||
--> $DIR/issue-20772.rs:1:1
|
--> $DIR/issue-20772.rs:1:1
|
||||||
|
|
|
|
||||||
LL | / trait T : Iterator<Item=Self::Item>
|
LL | / trait T : Iterator<Item=Self::Item>
|
||||||
|
@ -6,7 +6,7 @@ LL | |
|
||||||
LL | | {}
|
LL | | {}
|
||||||
| |__^
|
| |__^
|
||||||
|
|
|
|
||||||
= note: ...which again requires computing the supertraits of `T`, completing the cycle
|
= note: ...which again requires computing the super traits of `T` with associated type name `Item`, completing the cycle
|
||||||
note: cycle used when computing the super traits of `T`
|
note: cycle used when computing the super traits of `T`
|
||||||
--> $DIR/issue-20772.rs:1:1
|
--> $DIR/issue-20772.rs:1:1
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
error[E0391]: cycle detected when computing the supertraits of `Processor`
|
error[E0391]: cycle detected when computing the super traits of `Processor` with associated type name `Input`
|
||||||
--> $DIR/issue-20825.rs:5:1
|
--> $DIR/issue-20825.rs:5:1
|
||||||
|
|
|
|
||||||
LL | pub trait Processor: Subscriber<Input = Self::Input> {
|
LL | pub trait Processor: Subscriber<Input = Self::Input> {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: ...which again requires computing the supertraits of `Processor`, completing the cycle
|
= note: ...which again requires computing the super traits of `Processor` with associated type name `Input`, completing the cycle
|
||||||
note: cycle used when computing the super traits of `Processor`
|
note: cycle used when computing the super traits of `Processor`
|
||||||
--> $DIR/issue-20825.rs:5:1
|
--> $DIR/issue-20825.rs:5:1
|
||||||
|
|
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue