]> git.proxmox.com Git - rustc.git/blame - src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / kindck / kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
CommitLineData
1b1a35ee 1error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
e74abb32 2 --> $DIR/kindck-inherited-copy-bound.rs:21:16
b7449926 3 |
e1599b0c 4LL | fn take_param<T:Foo>(foo: &T) { }
ba9703b0 5 | --- required by this bound in `take_param`
e1599b0c 6...
532ac7d7 7LL | 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
12error[E0038]: the trait `Foo` cannot be made into an object
e74abb32 13 --> $DIR/kindck-inherited-copy-bound.rs:28:13
b7449926 14 |
29967ef6
XL
15LL | let z = &x as &dyn Foo;
16 | ^^ `Foo` cannot be made into an object
17 |
18note: 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 21LL | 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 28error: aborting due to 2 previous errors
b7449926 29
48663c56 30Some errors have detailed explanations: E0038, E0277.
b7449926 31For more information about an error, try `rustc --explain E0038`.