fork/rust

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

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

master
2.2 KiB54 linesraw
1error[E0277]: the trait bound `Box<{integer}>: Copy` is not satisfied
2  --> $DIR/kindck-inherited-copy-bound.rs:21:16
3   |
4LL |     take_param(&x);
5   |     ---------- ^^ the trait `Copy` is not implemented for `Box<{integer}>`
6   |     |
7   |     required by a bound introduced by this call
8   |
9note: required for `Box<{integer}>` to implement `Foo`
10  --> $DIR/kindck-inherited-copy-bound.rs:14:14
11   |
12LL | impl<T:Copy> Foo for T {
13   |        ----  ^^^     ^
14   |        |
15   |        unsatisfied trait bound introduced here
16note: required by a bound in `take_param`
17  --> $DIR/kindck-inherited-copy-bound.rs:17:17
18   |
19LL | fn take_param<T:Foo>(foo: &T) { }
20   |                 ^^^ required by this bound in `take_param`
21
22error[E0038]: the trait `Foo` cannot be made into an object
23  --> $DIR/kindck-inherited-copy-bound.rs:28:19
24   |
25LL |     let z = &x as &dyn Foo;
26   |                   ^^^^^^^^ `Foo` cannot be made into an object
27   |
28note: 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>
29  --> $DIR/kindck-inherited-copy-bound.rs:10:13
30   |
31LL | trait Foo : Copy {
32   |       ---   ^^^^ ...because it requires `Self: Sized`
33   |       |
34   |       this trait cannot be made into an object...
35
36error[E0038]: the trait `Foo` cannot be made into an object
37  --> $DIR/kindck-inherited-copy-bound.rs:28:13
38   |
39LL |     let z = &x as &dyn Foo;
40   |             ^^ `Foo` cannot be made into an object
41   |
42note: 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>
43  --> $DIR/kindck-inherited-copy-bound.rs:10:13
44   |
45LL | trait Foo : Copy {
46   |       ---   ^^^^ ...because it requires `Self: Sized`
47   |       |
48   |       this trait cannot be made into an object...
49   = note: required for the cast from `&Box<{integer}>` to `&dyn Foo`
50
51error: aborting due to 3 previous errors
52
53Some errors have detailed explanations: E0038, E0277.
54For more information about an error, try `rustc --explain E0038`.