diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2021-08-27 17:34:48 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2021-09-02 11:49:32 -0500 |
| commit | 611191f54c563587a9130b8cb4afba1856aebebc (patch) | |
| tree | a73f50f15f95da1e840cac2bf931ce7ac254b4a0 /src | |
| parent | f2d9ee9c342104880dd978e85260243d2dcedc9a (diff) | |
| download | rust-611191f54c563587a9130b8cb4afba1856aebebc.tar.gz rust-611191f54c563587a9130b8cb4afba1856aebebc.zip | |
Report cycle error using 'deepest' obligation in the cycle
Diffstat (limited to 'src')
8 files changed, 38 insertions, 19 deletions
diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-1.rs b/src/test/incremental/const-generics/hash-tyvid-regression-1.rs index b5a0108a0a3..5ff7b19d894 100644 --- a/src/test/incremental/const-generics/hash-tyvid-regression-1.rs +++ b/src/test/incremental/const-generics/hash-tyvid-regression-1.rs @@ -9,7 +9,8 @@ where use std::convert::TryFrom; <[T; N.get()]>::try_from(()) //~^ error: the trait bound - //~^^ error: mismatched types + //~| error: the trait bound + //~| error: mismatched types } fn main() {} diff --git a/src/test/ui/traits/cycle-cache-err-60010.rs b/src/test/ui/traits/cycle-cache-err-60010.rs index 88f0bd87253..94e718317e7 100644 --- a/src/test/ui/traits/cycle-cache-err-60010.rs +++ b/src/test/ui/traits/cycle-cache-err-60010.rs @@ -25,7 +25,7 @@ struct Runtime<DB: Database> { } struct SalsaStorage { _parse: <ParseQuery as Query<RootDatabase>>::Data, - //~^ ERROR overflow evaluating the requirement `RootDatabase: SourceDatabase` + //~^ ERROR overflow } impl Database for RootDatabase { diff --git a/src/test/ui/traits/cycle-cache-err-60010.stderr b/src/test/ui/traits/cycle-cache-err-60010.stderr index 91c2bd6c3b2..9452e11e302 100644 --- a/src/test/ui/traits/cycle-cache-err-60010.stderr +++ b/src/test/ui/traits/cycle-cache-err-60010.stderr @@ -1,9 +1,27 @@ -error[E0275]: overflow evaluating the requirement `RootDatabase: SourceDatabase` +error[E0275]: overflow evaluating the requirement `SalsaStorage: RefUnwindSafe` --> $DIR/cycle-cache-err-60010.rs:27:13 | LL | _parse: <ParseQuery as Query<RootDatabase>>::Data, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | + = note: required because it appears within the type `*const SalsaStorage` + = note: required because it appears within the type `Unique<SalsaStorage>` + = note: required because it appears within the type `Box<SalsaStorage>` +note: required because it appears within the type `Runtime<RootDatabase>` + --> $DIR/cycle-cache-err-60010.rs:23:8 + | +LL | struct Runtime<DB: Database> { + | ^^^^^^^ +note: required because it appears within the type `RootDatabase` + --> $DIR/cycle-cache-err-60010.rs:20:8 + | +LL | struct RootDatabase { + | ^^^^^^^^^^^^ +note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase` + --> $DIR/cycle-cache-err-60010.rs:44:9 + | +LL | impl<T> SourceDatabase for T + | ^^^^^^^^^^^^^^ ^ note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery` --> $DIR/cycle-cache-err-60010.rs:37:10 | diff --git a/src/test/ui/traits/inductive-overflow/lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs index 072c46bc21e..8be42fc4ad0 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.rs +++ b/src/test/ui/traits/inductive-overflow/lifetime.rs @@ -15,8 +15,8 @@ impl<'a> Y for C<'a> { struct C<'a>(&'a ()); struct X<T: Y>(T::P); -impl<T: NotAuto> NotAuto for Box<T> {} -impl<T: Y> NotAuto for X<T> where T::P: NotAuto {} //~ NOTE: required +impl<T: NotAuto> NotAuto for Box<T> {} //~ NOTE: required +impl<T: Y> NotAuto for X<T> where T::P: NotAuto {} impl<'a> NotAuto for C<'a> {} fn is_send<S: NotAuto>() {} @@ -26,6 +26,6 @@ fn main() { // Should only be a few notes. is_send::<X<C<'static>>>(); //~^ ERROR overflow evaluating - //~| 2 redundant requirements hidden + //~| 3 redundant requirements hidden //~| required because of } diff --git a/src/test/ui/traits/inductive-overflow/lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr index 2905deb940f..2ffcdb0e1c6 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.stderr +++ b/src/test/ui/traits/inductive-overflow/lifetime.stderr @@ -1,15 +1,15 @@ -error[E0275]: overflow evaluating the requirement `Box<X<C<'_>>>: NotAuto` +error[E0275]: overflow evaluating the requirement `X<C<'_>>: NotAuto` --> $DIR/lifetime.rs:27:5 | LL | is_send::<X<C<'static>>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | -note: required because of the requirements on the impl of `NotAuto` for `X<C<'_>>` - --> $DIR/lifetime.rs:19:12 +note: required because of the requirements on the impl of `NotAuto` for `Box<X<C<'_>>>` + --> $DIR/lifetime.rs:18:18 | -LL | impl<T: Y> NotAuto for X<T> where T::P: NotAuto {} - | ^^^^^^^ ^^^^ - = note: 2 redundant requirements hidden +LL | impl<T: NotAuto> NotAuto for Box<T> {} + | ^^^^^^^ ^^^^^^ + = note: 3 redundant requirements hidden = note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>` note: required by a bound in `is_send` --> $DIR/lifetime.rs:22:15 diff --git a/src/test/ui/traits/inductive-overflow/simultaneous.stderr b/src/test/ui/traits/inductive-overflow/simultaneous.stderr index 7eb1c9ffb3b..230c2638c50 100644 --- a/src/test/ui/traits/inductive-overflow/simultaneous.stderr +++ b/src/test/ui/traits/inductive-overflow/simultaneous.stderr @@ -1,4 +1,4 @@ -error[E0275]: overflow evaluating the requirement `{integer}: Tweedledee` +error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum` --> $DIR/simultaneous.rs:18:5 | LL | is_ee(4); diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr index ac7bbd272c7..86b3f87d34d 100644 --- a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr +++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr @@ -5,10 +5,10 @@ LL | type Foo = impl std::fmt::Debug; | ^^^^^^^^^^^^^^^^^^^^ | note: ...which requires type-checking `m::bar`... - --> $DIR/auto-trait-leakage3.rs:14:5 + --> $DIR/auto-trait-leakage3.rs:15:9 | -LL | pub fn bar() { - | ^^^^^^^^^^^^ +LL | is_send(foo()); + | ^^^^^^^ = note: ...which requires evaluating trait selection obligation `impl std::fmt::Debug: std::marker::Send`... = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle note: cycle used when checking item types in module `m` diff --git a/src/test/ui/type-alias-impl-trait/inference-cycle.stderr b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr index ac0ca8e048c..4c5921c7f66 100644 --- a/src/test/ui/type-alias-impl-trait/inference-cycle.stderr +++ b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr @@ -5,10 +5,10 @@ LL | type Foo = impl std::fmt::Debug; | ^^^^^^^^^^^^^^^^^^^^ | note: ...which requires type-checking `m::bar`... - --> $DIR/inference-cycle.rs:14:5 + --> $DIR/inference-cycle.rs:15:9 | -LL | pub fn bar() { - | ^^^^^^^^^^^^ +LL | is_send(foo()); // Today: error + | ^^^^^^^ = note: ...which requires evaluating trait selection obligation `impl std::fmt::Debug: std::marker::Send`... = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle note: cycle used when checking item types in module `m` |
