2020-09-02 02:40:56 -05:00
error[E0277]: the trait bound `U: Copy` is not satisfied
2020-01-29 18:55:37 -06:00
--> $DIR/wf-fn-where-clause.rs:8:24
2018-08-08 07:28:26 -05:00
|
2020-01-18 16:57:56 -06:00
LL | fn foo<T,U>() where T: ExtraCopy<U>
2020-09-02 02:40:56 -05:00
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
2019-12-26 06:43:33 -06:00
|
2021-07-31 11:26:55 -05:00
note: required by a bound in `ExtraCopy`
--> $DIR/wf-fn-where-clause.rs:6:19
|
LL | trait ExtraCopy<T:Copy> { }
| ^^^^ required by this bound in `ExtraCopy`
2020-03-13 21:28:14 -05:00
help: consider further restricting type parameter `U`
2019-12-26 06:43:33 -06:00
|
2021-03-30 04:56:39 -05:00
LL | fn foo<T,U>() where T: ExtraCopy<U>, U: std::marker::Copy
2021-06-21 21:07:19 -05:00
| ++++++++++++++++++++++
2018-08-08 07:28:26 -05:00
2020-09-02 02:40:56 -05:00
error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
2020-01-29 18:55:37 -06:00
--> $DIR/wf-fn-where-clause.rs:12:16
2018-08-25 16:28:23 -05:00
|
LL | fn bar() where Vec<dyn Copy>:, {}
2020-01-29 18:55:37 -06:00
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
2018-08-25 16:28:23 -05:00
|
2020-09-02 02:40:56 -05:00
= help: the trait `Sized` is not implemented for `(dyn Copy + 'static)`
2021-07-31 11:26:55 -05:00
note: required by a bound in `Vec`
--> $DIR/wf-fn-where-clause.rs:16:12
|
LL | struct Vec<T> {
| ^ required by this bound in `Vec`
2020-06-16 19:24:16 -05:00
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/wf-fn-where-clause.rs:16:12
|
LL | struct Vec<T> {
| ^ this could be changed to `T: ?Sized`...
LL | t: T,
2021-02-03 23:41:18 -06:00
| - ...if indirection were used here: `Box<T>`
2018-08-25 16:28:23 -05:00
2020-09-02 02:40:56 -05:00
error[E0038]: the trait `Copy` cannot be made into an object
2020-01-29 18:55:37 -06:00
--> $DIR/wf-fn-where-clause.rs:12:16
2018-08-25 16:28:23 -05:00
|
LL | fn bar() where Vec<dyn Copy>:, {}
2020-10-19 19:57:18 -05:00
| ^^^^^^^^^^^^^ `Copy` cannot be made into an object
2018-08-25 16:28:23 -05:00
|
2020-01-31 18:47:00 -06:00
= note: the trait cannot be made into an object because it requires `Self: Sized`
2020-10-15 19:23:45 -05:00
= note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
2018-08-25 16:28:23 -05:00
error: aborting due to 3 previous errors
2018-08-08 07:28:26 -05:00
2019-04-17 12:26:38 -05:00
Some errors have detailed explanations: E0038, E0277.
2018-08-25 16:28:23 -05:00
For more information about an error, try `rustc --explain E0038`.