]>
Commit | Line | Data |
---|---|---|
1b1a35ee | 1 | error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied |
e74abb32 | 2 | --> $DIR/kindck-inherited-copy-bound.rs:21:16 |
b7449926 | 3 | | |
e1599b0c | 4 | LL | fn take_param<T:Foo>(foo: &T) { } |
ba9703b0 | 5 | | --- required by this bound in `take_param` |
e1599b0c | 6 | ... |
532ac7d7 | 7 | LL | take_param(&x); |
1b1a35ee | 8 | | ^^ the trait `Copy` is not implemented for `Box<{integer}>` |
b7449926 | 9 | | |
1b1a35ee | 10 | = note: required because of the requirements on the impl of `Foo` for `Box<{integer}>` |
b7449926 XL |
11 | |
12 | error[E0038]: the trait `Foo` cannot be made into an object | |
e74abb32 | 13 | --> $DIR/kindck-inherited-copy-bound.rs:28:13 |
b7449926 | 14 | | |
29967ef6 XL |
15 | LL | let z = &x as &dyn Foo; |
16 | | ^^ `Foo` cannot be made into an object | |
17 | | | |
18 | 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> | |
19 | --> $DIR/kindck-inherited-copy-bound.rs:10:13 | |
20 | | | |
74b04a01 | 21 | LL | trait Foo : Copy { |
29967ef6 | 22 | | --- ^^^^ ...because it requires `Self: Sized` |
74b04a01 XL |
23 | | | |
24 | | this trait cannot be made into an object... | |
1b1a35ee | 25 | = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Foo>` for `&Box<i32>` |
e74abb32 | 26 | = note: required by cast to type `&dyn Foo` |
b7449926 | 27 | |
e74abb32 | 28 | error: aborting due to 2 previous errors |
b7449926 | 29 | |
48663c56 | 30 | Some errors have detailed explanations: E0038, E0277. |
b7449926 | 31 | For more information about an error, try `rustc --explain E0038`. |