fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.4 KiB33 linesraw
1error[E0038]: the trait `Trait` cannot be made into an object
2  --> $DIR/wf-convert-unsafe-trait-obj.rs:16:25
3   |
4LL |     let t: &dyn Trait = &S;
5   |                         ^^ the trait `Trait` cannot be made into an object
6   |
7   = note: the trait cannot require that `Self : Sized`
8   = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Trait>` for `&S`
9   = note: required by cast to type `&dyn Trait`
10
11error[E0038]: the trait `Trait` cannot be made into an object
12  --> $DIR/wf-convert-unsafe-trait-obj.rs:17:17
13   |
14LL |     takes_trait(&S);
15   |                 ^^ the trait `Trait` cannot be made into an object
16   |
17   = note: the trait cannot require that `Self : Sized`
18   = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Trait>` for `&S`
19   = note: required by cast to type `&dyn Trait`
20
21error[E0038]: the trait `Trait` cannot be made into an object
22  --> $DIR/wf-convert-unsafe-trait-obj.rs:15:5
23   |
24LL |     &S as &dyn Trait;
25   |     ^^ the trait `Trait` cannot be made into an object
26   |
27   = note: the trait cannot require that `Self : Sized`
28   = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Trait>` for `&S`
29   = note: required by cast to type `&dyn Trait`
30
31error: aborting due to 3 previous errors
32
33For more information about this error, try `rustc --explain E0038`.