Point out why a trait is expected on Struct + 'lt
This commit is contained in:
parent
5ddef544fa
commit
711760c8ec
3 changed files with 23 additions and 1 deletions
|
|
@ -3,6 +3,12 @@ error[E0404]: expected trait, found struct `Foo`
|
|||
|
|
||||
LL | fn foo(_x: Box<Foo + Send>) { }
|
||||
| ^^^ not a trait
|
||||
|
|
||||
help: `+` can be used to constrain a "trait object" type with lifetimes or auto-traits, structs and enums can't be bound in that way
|
||||
--> $DIR/trait-bounds-not-on-struct.rs:5:16
|
||||
|
|
||||
LL | fn foo(_x: Box<Foo + Send>) { }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0404]: expected trait, found struct `Vec`
|
||||
--> $DIR/trait-bounds-not-on-struct.rs:7:21
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue