Use PredicateObligations instead of Predicates
Keep more information about trait binding failures.
This commit is contained in:
parent
485c5fb6e1
commit
bd7ea5441e
90 changed files with 280 additions and 141 deletions
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotCopy: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-const-type.rs:10:12
|
||||
|
|
||||
LL | struct IsCopy<T:Copy> { t: T }
|
||||
| --------------------- required by `IsCopy`
|
||||
| ------ ---- required by this bound in `IsCopy`
|
||||
...
|
||||
LL | const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `NotCopy`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-enum-bound.rs:10:14
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
...
|
||||
LL | where T: ExtraCopy<U>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-enum-fields-struct-variant.rs:13:9
|
||||
|
|
||||
LL | struct IsCopy<T:Copy> {
|
||||
| --------------------- required by `IsCopy`
|
||||
| ------ ---- required by this bound in `IsCopy`
|
||||
...
|
||||
LL | f: IsCopy<A>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-enum-fields.rs:12:17
|
||||
|
|
||||
LL | struct IsCopy<T:Copy> {
|
||||
| --------------------- required by `IsCopy`
|
||||
| ------ ---- required by this bound in `IsCopy`
|
||||
...
|
||||
LL | SomeVariant(IsCopy<A>)
|
||||
| ^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A`
|
||||
|
|
|
|||
|
|
@ -13,5 +13,8 @@ fn bar() where Vec<dyn Copy>:, {}
|
|||
//~^ ERROR E0277
|
||||
//~| ERROR E0038
|
||||
|
||||
struct Vec<T> {
|
||||
t: T,
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-fn-where-clause.rs:8:24
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
LL |
|
||||
LL | fn foo<T,U>() where T: ExtraCopy<U>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
@ -17,10 +17,12 @@ error[E0277]: the size for values of type `(dyn std::marker::Copy + 'static)` ca
|
|||
|
|
||||
LL | fn bar() where Vec<dyn Copy>:, {}
|
||||
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
...
|
||||
LL | struct Vec<T> {
|
||||
| --- - required by this bound in `Vec`
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::marker::Copy + 'static)`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= note: required by `std::vec::Vec`
|
||||
|
||||
error[E0038]: the trait `std::marker::Copy` cannot be made into an object
|
||||
--> $DIR/wf-fn-where-clause.rs:12:16
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: MyHash` is not satisfied
|
|||
--> $DIR/wf-impl-associated-type-trait.rs:17:5
|
||||
|
|
||||
LL | pub struct MySet<T:MyHash> {
|
||||
| -------------------------- required by `MySet`
|
||||
| ----- ------ required by this bound in `MySet`
|
||||
...
|
||||
LL | type Bar = MySet<T>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `MyHash` is not implemented for `T`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-in-fn-arg.rs:10:14
|
||||
|
|
||||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
| ---------- ---- required by this bound in `MustBeCopy`
|
||||
...
|
||||
LL | fn bar<T>(_: &MustBeCopy<T>)
|
||||
| ^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-in-fn-ret.rs:10:16
|
||||
|
|
||||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
| ---------- ---- required by this bound in `MustBeCopy`
|
||||
...
|
||||
LL | fn bar<T>() -> MustBeCopy<T>
|
||||
| ^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-in-fn-type-arg.rs:9:5
|
||||
|
|
||||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
| ---------- ---- required by this bound in `MustBeCopy`
|
||||
...
|
||||
LL | x: fn(MustBeCopy<T>)
|
||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-in-fn-type-ret.rs:9:5
|
||||
|
|
||||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
| ---------- ---- required by this bound in `MustBeCopy`
|
||||
...
|
||||
LL | x: fn() -> MustBeCopy<T>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-in-fn-where-clause.rs:10:14
|
||||
|
|
||||
LL | trait MustBeCopy<T:Copy> {
|
||||
| ------------------------ required by `MustBeCopy`
|
||||
| ---------- ---- required by this bound in `MustBeCopy`
|
||||
...
|
||||
LL | where T: MustBeCopy<U>
|
||||
| ^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-in-obj-type-trait.rs:11:5
|
||||
|
|
||||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
| ---------- ---- required by this bound in `MustBeCopy`
|
||||
...
|
||||
LL | x: dyn Object<MustBeCopy<T>>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-inherent-impl-method-where-clause.rs:12:27
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
...
|
||||
LL | fn foo(self) where T: ExtraCopy<U>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-inherent-impl-where-clause.rs:11:29
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
...
|
||||
LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotCopy: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-static-type.rs:10:13
|
||||
|
|
||||
LL | struct IsCopy<T:Copy> { t: T }
|
||||
| --------------------- required by `IsCopy`
|
||||
| ------ ---- required by this bound in `IsCopy`
|
||||
...
|
||||
LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `NotCopy`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-struct-bound.rs:10:14
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
...
|
||||
LL | where T: ExtraCopy<U>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-struct-field.rs:12:5
|
||||
|
|
||||
LL | struct IsCopy<T:Copy> {
|
||||
| --------------------- required by `IsCopy`
|
||||
| ------ ---- required by this bound in `IsCopy`
|
||||
...
|
||||
LL | data: IsCopy<A>
|
||||
| ^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-trait-associated-type-bound.rs:10:17
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
...
|
||||
LL | type Type1: ExtraCopy<T>;
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `<Self as SomeTrait>::Type1: std::marker::Copy` is
|
|||
--> $DIR/wf-trait-associated-type-trait.rs:11:5
|
||||
|
|
||||
LL | struct IsCopy<T:Copy> { x: T }
|
||||
| --------------------- required by `IsCopy`
|
||||
| ------ ---- required by this bound in `IsCopy`
|
||||
LL |
|
||||
LL | trait SomeTrait {
|
||||
| - help: consider further restricting the associated type: `where <Self as SomeTrait>::Type1: std::marker::Copy`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-trait-bound.rs:10:14
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
...
|
||||
LL | where T: ExtraCopy<U>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
|
|||
--> $DIR/wf-trait-default-fn-arg.rs:11:22
|
||||
|
|
||||
LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
|
||||
| ----------------------- required by `Bar`
|
||||
| --- -- required by this bound in `Bar`
|
||||
...
|
||||
LL | fn bar(&self, x: &Bar<Self>) {
|
||||
| ^^^^^^^^^^ - help: consider further restricting `Self`: `where Self: std::cmp::Eq`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
|
|||
--> $DIR/wf-trait-default-fn-ret.rs:11:22
|
||||
|
|
||||
LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
|
||||
| ----------------------- required by `Bar`
|
||||
| --- -- required by this bound in `Bar`
|
||||
...
|
||||
LL | fn bar(&self) -> Bar<Self> {
|
||||
| ^^^^^^^^^- help: consider further restricting `Self`: `where Self: std::cmp::Eq`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
|
|||
--> $DIR/wf-trait-default-fn-where-clause.rs:11:31
|
||||
|
|
||||
LL | trait Bar<T:Eq+?Sized> { }
|
||||
| ---------------------- required by `Bar`
|
||||
| --- -- required by this bound in `Bar`
|
||||
...
|
||||
LL | fn bar<A>(&self) where A: Bar<Self> {
|
||||
| ^^^^^^^^^- help: consider further restricting `Self`: `, Self: std::cmp::Eq`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
|
|||
--> $DIR/wf-trait-fn-arg.rs:10:22
|
||||
|
|
||||
LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
|
||||
| ----------------------- required by `Bar`
|
||||
| --- -- required by this bound in `Bar`
|
||||
...
|
||||
LL | fn bar(&self, x: &Bar<Self>);
|
||||
| ^^^^^^^^^^ - help: consider further restricting `Self`: `where Self: std::cmp::Eq`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
|
|||
--> $DIR/wf-trait-fn-ret.rs:10:22
|
||||
|
|
||||
LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
|
||||
| ----------------------- required by `Bar`
|
||||
| --- -- required by this bound in `Bar`
|
||||
...
|
||||
LL | fn bar(&self) -> &Bar<Self>;
|
||||
| ^^^^^^^^^^- help: consider further restricting `Self`: `where Self: std::cmp::Eq`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
|
|||
--> $DIR/wf-trait-fn-where-clause.rs:10:49
|
||||
|
|
||||
LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
|
||||
| ----------------------- required by `Bar`
|
||||
| --- -- required by this bound in `Bar`
|
||||
...
|
||||
LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy;
|
||||
| ^^^^- help: consider further restricting `Self`: `, Self: std::cmp::Eq`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/wf-trait-superbound.rs:9:21
|
||||
|
|
||||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
| --------- ---- required by this bound in `ExtraCopy`
|
||||
LL |
|
||||
LL | trait SomeTrait<T>: ExtraCopy<T> {
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue