fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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