Point at the Sized obligation in where clauses
This commit is contained in:
parent
4b2f1db6e4
commit
972ae5afe5
3 changed files with 41 additions and 7 deletions
|
|
@ -1,10 +1,11 @@
|
|||
error[E0038]: the trait `Bar` cannot be made into an object
|
||||
--> $DIR/object-safety-sized-2.rs:14:30
|
||||
|
|
||||
LL | where Self : Sized
|
||||
| ----- the trait cannot require that `Self : Sized`
|
||||
...
|
||||
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
|
||||
| ^^^^^^^^ the trait `Bar` cannot be made into an object
|
||||
|
|
||||
= note: the trait cannot require that `Self : Sized`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
error[E0038]: the trait `Bar` cannot be made into an object
|
||||
--> $DIR/object-safety-sized-2.rs:16:5
|
||||
|
|
||||
LL | where Self : Sized
|
||||
| ----- the trait cannot require that `Self : Sized`
|
||||
...
|
||||
LL | t
|
||||
| ^ the trait `Bar` cannot be made into an object
|
||||
|
|
||||
= note: the trait cannot require that `Self : Sized`
|
||||
= note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Bar>` for `&T`
|
||||
= note: required by cast to type `&dyn Bar`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue