]> git.lizzy.rs Git - rust.git/blob - src/test/ui/wf/wf-fn-where-clause.stderr
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / wf / wf-fn-where-clause.stderr
1 error[E0277]: the trait bound `U: Copy` is not satisfied
2   --> $DIR/wf-fn-where-clause.rs:8:24
3    |
4 LL | trait ExtraCopy<T:Copy> { }
5    |                   ---- required by this bound in `ExtraCopy`
6 LL | 
7 LL | fn foo<T,U>() where T: ExtraCopy<U>
8    |                        ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
9    |
10 help: consider further restricting type parameter `U`
11    |
12 LL | fn foo<T,U>() where T: ExtraCopy<U>, U: std::marker::Copy
13    |                                    ^^^^^^^^^^^^^^^^^^^^^^
14
15 error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
16   --> $DIR/wf-fn-where-clause.rs:12:16
17    |
18 LL | fn bar() where Vec<dyn Copy>:, {}
19    |                ^^^^^^^^^^^^^ doesn't have a size known at compile-time
20 ...
21 LL | struct Vec<T> {
22    |            - required by this bound in `Vec`
23    |
24    = help: the trait `Sized` is not implemented for `(dyn Copy + 'static)`
25 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
26   --> $DIR/wf-fn-where-clause.rs:16:12
27    |
28 LL | struct Vec<T> {
29    |            ^ this could be changed to `T: ?Sized`...
30 LL |     t: T,
31    |        - ...if indirection were used here: `Box<T>`
32
33 error[E0038]: the trait `Copy` cannot be made into an object
34   --> $DIR/wf-fn-where-clause.rs:12:16
35    |
36 LL | fn bar() where Vec<dyn Copy>:, {}
37    |                ^^^^^^^^^^^^^ `Copy` cannot be made into an object
38    |
39    = note: the trait cannot be made into an object because it requires `Self: Sized`
40    = 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>
41
42 error: aborting due to 3 previous errors
43
44 Some errors have detailed explanations: E0038, E0277.
45 For more information about an error, try `rustc --explain E0038`.