fork/rust

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

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

master
1.5 KiB40 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:13
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   = note: required for the cast from `&Box<i32>` to `&dyn Foo`
36
37error: aborting due to 2 previous errors
38
39Some errors have detailed explanations: E0038, E0277.
40For more information about an error, try `rustc --explain E0038`.