From b916ac6322592b5baf4eee7c98cecf1e300f208b Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 22 Nov 2020 20:08:00 -0300 Subject: [PATCH] adjust super_predicates_that_define_assoc_type query description --- compiler/rustc_middle/src/query/mod.rs | 5 ++++- .../ambiguous-associated-type2.rs | 4 +++- .../ambiguous-associated-type2.stderr | 10 +++++----- .../cycle-trait/cycle-trait-supertrait-direct.stderr | 2 +- .../cycle-trait/cycle-trait-supertrait-indirect.stderr | 6 +++--- src/test/ui/issues/issue-12511.stderr | 4 ++-- src/test/ui/issues/issue-20772.stderr | 6 +++--- src/test/ui/issues/issue-20825.stderr | 6 +++--- 8 files changed, 24 insertions(+), 19 deletions(-) diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 37dd1a1cf5f..d7718dea437 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -449,7 +449,10 @@ rustc_queries! { /// full predicates are available (note that supertraits have /// additional acyclicity requirements). query super_predicates_that_define_assoc_type(key: (DefId, Option)) -> 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 diff --git a/src/test/ui/associated-type-bounds/ambiguous-associated-type2.rs b/src/test/ui/associated-type-bounds/ambiguous-associated-type2.rs index 92b5dc1a1fb..1b6d6d0ff59 100644 --- a/src/test/ui/associated-type-bounds/ambiguous-associated-type2.rs +++ b/src/test/ui/associated-type-bounds/ambiguous-associated-type2.rs @@ -1,3 +1,5 @@ +// ignore-tidy-linelength + trait Foo { type Item; } @@ -5,6 +7,6 @@ trait Bar { type Item; } trait Baz: Foo + Bar {} -//~^ 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() {} diff --git a/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr b/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr index 1a168a59541..bda1debeac0 100644 --- a/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr +++ b/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr @@ -1,12 +1,12 @@ -error[E0391]: cycle detected when computing the supertraits of `Baz` - --> $DIR/ambiguous-associated-type2.rs:7:1 +error[E0391]: cycle detected when computing the super traits of `Baz` with associated type name `Item` + --> $DIR/ambiguous-associated-type2.rs:9:1 | LL | trait Baz: Foo + Bar {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: ...which again requires computing the supertraits of `Baz`, completing the cycle -note: cycle used when computing the supertraits of `Baz` - --> $DIR/ambiguous-associated-type2.rs:7:1 + = 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` + --> $DIR/ambiguous-associated-type2.rs:9:1 | LL | trait Baz: Foo + Bar {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr b/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr index 3635803a1c5..ee54b2fd151 100644 --- a/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr +++ b/src/test/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 requires computing the supertraits of `Chromosome`... +note: ...which requires computing the super traits of `Chromosome`... --> $DIR/cycle-trait-supertrait-direct.rs:3:19 | LL | trait Chromosome: Chromosome { diff --git a/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr b/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr index 74cc41665f5..0a2284e0efb 100644 --- a/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr +++ b/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super predicates of `B` LL | trait B: C { | ^^^^^^^^^^ | -note: ...which requires computing the supertraits of `B`... +note: ...which requires computing the super traits of `B`... --> $DIR/cycle-trait-supertrait-indirect.rs:7:10 | LL | trait B: C { @@ -14,13 +14,13 @@ note: ...which requires computing the super predicates of `C`... | LL | trait C: B { } | ^^^^^^^^^^ -note: ...which requires computing the supertraits of `C`... +note: ...which requires computing the super traits 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 -note: cycle used when computing the supertraits of `A` +note: cycle used when computing the super traits of `A` --> $DIR/cycle-trait-supertrait-indirect.rs:4:10 | LL | trait A: B { diff --git a/src/test/ui/issues/issue-12511.stderr b/src/test/ui/issues/issue-12511.stderr index d1b0e63054f..5f2b98c5237 100644 --- a/src/test/ui/issues/issue-12511.stderr +++ b/src/test/ui/issues/issue-12511.stderr @@ -4,7 +4,7 @@ error[E0391]: cycle detected when computing the super predicates of `T1` LL | trait T1 : T2 { | ^^^^^^^^^^^^^ | -note: ...which requires computing the supertraits of `T1`... +note: ...which requires computing the super traits of `T1`... --> $DIR/issue-12511.rs:1:12 | LL | trait T1 : T2 { @@ -14,7 +14,7 @@ note: ...which requires computing the super predicates of `T2`... | LL | trait T2 : T1 { | ^^^^^^^^^^^^^ -note: ...which requires computing the supertraits of `T2`... +note: ...which requires computing the super traits of `T2`... --> $DIR/issue-12511.rs:5:12 | LL | trait T2 : T1 { diff --git a/src/test/ui/issues/issue-20772.stderr b/src/test/ui/issues/issue-20772.stderr index 6165337d024..4aecc7eab46 100644 --- a/src/test/ui/issues/issue-20772.stderr +++ b/src/test/ui/issues/issue-20772.stderr @@ -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 | LL | / trait T : Iterator @@ -6,8 +6,8 @@ LL | | LL | | {} | |__^ | - = note: ...which again requires computing the supertraits of `T`, completing the cycle -note: cycle used when computing the supertraits of `T` + = 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` --> $DIR/issue-20772.rs:1:1 | LL | / trait T : Iterator diff --git a/src/test/ui/issues/issue-20825.stderr b/src/test/ui/issues/issue-20825.stderr index a09a5290c37..ccbe06d9c0d 100644 --- a/src/test/ui/issues/issue-20825.stderr +++ b/src/test/ui/issues/issue-20825.stderr @@ -1,11 +1,11 @@ -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 | LL | pub trait Processor: Subscriber { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: ...which again requires computing the supertraits of `Processor`, completing the cycle -note: cycle used when computing the supertraits of `Processor` + = 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` --> $DIR/issue-20825.rs:5:1 | LL | pub trait Processor: Subscriber {