fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.5 KiB40 linesraw
1error[E0277]: the trait bound `std::boxed::Box<{integer}>: Foo` is not satisfied
2  --> $DIR/kindck-inherited-copy-bound.rs:21:16
3   |
4LL | fn take_param<T:Foo>(foo: &T) { }
5   |                 --- required by this bound in `take_param`
6...
7LL |     take_param(&x);
8   |                ^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>`
9   |
10   = note: required because of the requirements on the impl of `Foo` for `std::boxed::Box<{integer}>`
11
12error[E0038]: the trait `Foo` cannot be made into an object
13  --> $DIR/kindck-inherited-copy-bound.rs:28:19
14   |
15LL | trait Foo : Copy {
16   |       ---   ---- ...because it requires `Self: Sized`
17   |       |
18   |       this trait cannot be made into an object...
19...
20LL |     let z = &x as &dyn Foo;
21   |                   ^^^^^^^^ the trait `Foo` cannot be made into an object
22
23error[E0038]: the trait `Foo` cannot be made into an object
24  --> $DIR/kindck-inherited-copy-bound.rs:28:13
25   |
26LL | trait Foo : Copy {
27   |       ---   ---- ...because it requires `Self: Sized`
28   |       |
29   |       this trait cannot be made into an object...
30...
31LL |     let z = &x as &dyn Foo;
32   |             ^^ the trait `Foo` cannot be made into an object
33   |
34   = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Foo>` for `&std::boxed::Box<{integer}>`
35   = note: required by cast to type `&dyn Foo`
36
37error: aborting due to 3 previous errors
38
39Some errors have detailed explanations: E0038, E0277.
40For more information about an error, try `rustc --explain E0038`.