diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-03-03 15:07:04 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-04-08 14:40:45 -0700 |
| commit | bd7ea5441ec6e447d8dae1e69de7ef4320a2aa4e (patch) | |
| tree | ee02aacbe98954838effb64a4d3929cec7f76be9 /src/test/ui/traits | |
| parent | 485c5fb6e1bf12cd11a8fac5ee94962e17cff74b (diff) | |
| download | rust-bd7ea5441ec6e447d8dae1e69de7ef4320a2aa4e.tar.gz rust-bd7ea5441ec6e447d8dae1e69de7ef4320a2aa4e.zip | |
Use `PredicateObligation`s instead of `Predicate`s
Keep more information about trait binding failures.
Diffstat (limited to 'src/test/ui/traits')
9 files changed, 26 insertions, 17 deletions
diff --git a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr index 69a91b09e3e..ffed905eff2 100644 --- a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr +++ b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr @@ -13,7 +13,7 @@ error[E0277]: `dummy::TestType` cannot be sent between threads safely --> $DIR/negated-auto-traits-error.rs:23:5 | LL | struct Outer<T: Send>(T); - | ------------------------- required by `Outer` + | ----- ---- required by this bound in `Outer` ... LL | Outer(TestType); | ^^^^^^^^^^^^^^^ `dummy::TestType` cannot be sent between threads safely diff --git a/src/test/ui/traits/trait-alias/trait-alias-wf.stderr b/src/test/ui/traits/trait-alias/trait-alias-wf.stderr index ca4980ca305..84cde07ed89 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-wf.stderr +++ b/src/test/ui/traits/trait-alias/trait-alias-wf.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: Foo` is not satisfied --> $DIR/trait-alias-wf.rs:5:14 | LL | trait A<T: Foo> {} - | --------------- required by `A` + | - --- required by this bound in `A` LL | trait B<T> = A<T>; | ^^^^ the trait `Foo` is not implemented for `T` | diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr index a2253021a7f..1b2511be6d0 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr +++ b/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `u32: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:13:15 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | fn explode(x: Foo<u32>) {} | ^^^^^^^^ the trait `Trait` is not implemented for `u32` @@ -11,7 +11,7 @@ error[E0277]: the trait bound `f32: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:16:14 | LL | enum Bar<T:Trait> { - | ----------------- required by `Bar` + | --- ----- required by this bound in `Bar` ... LL | fn kaboom(y: Bar<f32>) {} | ^^^^^^^^ the trait `Trait` is not implemented for `f32` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr index 7e8db610fe2..58dd68c1768 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr +++ b/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `u16: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums-in-impls.rs:20:6 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | impl PolyTrait<Foo<u16>> for Struct { | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u16` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr index 070b7b013e5..f364fd1e14c 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr +++ b/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums-locals.rs:15:14 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | let baz: Foo<usize> = loop { }; | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr index 722f01750cb..17b1288bc6a 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr +++ b/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums-static.rs:9:11 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | static X: Foo<usize> = Foo { | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr index c5a7746afdf..d2fa211b487 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr +++ b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr @@ -3,16 +3,22 @@ error[E0277]: the trait bound `usize: trait_bounds_on_structs_and_enums_xc::Trai | LL | fn explode(x: Foo<usize>) {} | ^^^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `usize` + | + ::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:5:18 | - = note: required by `trait_bounds_on_structs_and_enums_xc::Foo` +LL | pub struct Foo<T:Trait> { + | ----- required by this bound in `trait_bounds_on_structs_and_enums_xc::Foo` error[E0277]: the trait bound `f32: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums-xc.rs:10:14 | LL | fn kaboom(y: Bar<f32>) {} | ^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f32` + | + ::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:9:16 | - = note: required by `trait_bounds_on_structs_and_enums_xc::Bar` +LL | pub enum Bar<T:Trait> { + | ----- required by this bound in `trait_bounds_on_structs_and_enums_xc::Bar` error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr index 57db65df5f3..ee3e755c953 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr +++ b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr @@ -3,8 +3,11 @@ error[E0277]: the trait bound `f64: trait_bounds_on_structs_and_enums_xc::Trait` | LL | let bar: Bar<f64> = return; | ^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f64` + | + ::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:9:16 | - = note: required by `trait_bounds_on_structs_and_enums_xc::Bar` +LL | pub enum Bar<T:Trait> { + | ----- required by this bound in `trait_bounds_on_structs_and_enums_xc::Bar` error[E0277]: the trait bound `{integer}: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums-xc1.rs:8:15 diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr index 9e8e5e08145..16dba294b6c 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr +++ b/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums.rs:13:9 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | impl<T> Foo<T> { | ^^^^^^ the trait `Trait` is not implemented for `T` @@ -16,7 +16,7 @@ error[E0277]: the trait bound `isize: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums.rs:19:5 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | a: Foo<isize>, | ^^^^^^^^^^^^^ the trait `Trait` is not implemented for `isize` @@ -25,7 +25,7 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums.rs:23:10 | LL | enum Bar<T:Trait> { - | ----------------- required by `Bar` + | --- ----- required by this bound in `Bar` ... LL | Quux(Bar<usize>), | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` @@ -34,7 +34,7 @@ error[E0277]: the trait bound `U: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums.rs:27:5 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | b: Foo<U>, | ^^^^^^^^^ the trait `Trait` is not implemented for `U` @@ -48,7 +48,7 @@ error[E0277]: the trait bound `V: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums.rs:31:21 | LL | enum Bar<T:Trait> { - | ----------------- required by `Bar` + | --- ----- required by this bound in `Bar` ... LL | EvenMoreBadness(Bar<V>), | ^^^^^^ the trait `Trait` is not implemented for `V` @@ -62,7 +62,7 @@ error[E0277]: the trait bound `i32: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums.rs:35:5 | LL | struct Foo<T:Trait> { - | ------------------- required by `Foo` + | --- ----- required by this bound in `Foo` ... LL | Foo<i32>, | ^^^^^^^^ the trait `Trait` is not implemented for `i32` @@ -71,7 +71,7 @@ error[E0277]: the trait bound `u8: Trait` is not satisfied --> $DIR/trait-bounds-on-structs-and-enums.rs:39:22 | LL | enum Bar<T:Trait> { - | ----------------- required by `Bar` + | --- ----- required by this bound in `Bar` ... LL | DictionaryLike { field: Bar<u8> }, | ^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u8` |
