]> git.proxmox.com Git - rustc.git/blame - src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr
New upstream version 1.48.0+dfsg1
[rustc.git] / src / test / ui / wf / wf-convert-unsafe-trait-obj-box.stderr
CommitLineData
e74abb32
XL
1error[E0038]: the trait `Trait` cannot be made into an object
2 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:16:33
3 |
74b04a01
XL
4LL | trait Trait: Sized {}
5 | ----- ----- ...because it requires `Self: Sized`
6 | |
7 | this trait cannot be made into an object...
8...
e74abb32
XL
9LL | let t_box: Box<dyn Trait> = Box::new(S);
10 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
11 |
1b1a35ee
XL
12 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
13 = note: required by cast to type `Box<dyn Trait>`
e74abb32
XL
14
15error[E0038]: the trait `Trait` cannot be made into an object
16 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:17:15
17 |
74b04a01
XL
18LL | trait Trait: Sized {}
19 | ----- ----- ...because it requires `Self: Sized`
20 | |
21 | this trait cannot be made into an object...
22...
e74abb32
XL
23LL | takes_box(Box::new(S));
24 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
25 |
1b1a35ee
XL
26 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
27 = note: required by cast to type `Box<(dyn Trait + 'static)>`
e74abb32
XL
28
29error[E0038]: the trait `Trait` cannot be made into an object
30 --> $DIR/wf-convert-unsafe-trait-obj-box.rs:15:5
31 |
74b04a01
XL
32LL | trait Trait: Sized {}
33 | ----- ----- ...because it requires `Self: Sized`
34 | |
35 | this trait cannot be made into an object...
36...
e74abb32
XL
37LL | Box::new(S) as Box<dyn Trait>;
38 | ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
39 |
1b1a35ee
XL
40 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
41 = note: required by cast to type `Box<dyn Trait>`
e74abb32
XL
42
43error: aborting due to 3 previous errors
44
45For more information about this error, try `rustc --explain E0038`.