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