]> git.proxmox.com Git - rustc.git/blame - tests/ui/wf/wf-convert-unsafe-trait-obj.stderr
New upstream version 1.71.1+dfsg1
[rustc.git] / tests / ui / wf / wf-convert-unsafe-trait-obj.stderr
CommitLineData
e74abb32
XL
1error[E0038]: the trait `Trait` cannot be made into an object
2 --> $DIR/wf-convert-unsafe-trait-obj.rs:16:25
3 |
29967ef6
XL
4LL | let t: &dyn Trait = &S;
5 | ^^ `Trait` cannot be made into an object
6 |
7note: 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>
8 --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14
9 |
74b04a01 10LL | trait Trait: Sized {}
29967ef6 11 | ----- ^^^^^ ...because it requires `Self: Sized`
74b04a01
XL
12 | |
13 | this trait cannot be made into an object...
49aad941 14 = note: required for the cast from `&S` to `&dyn Trait`
e74abb32
XL
15
16error[E0038]: the trait `Trait` cannot be made into an object
17 --> $DIR/wf-convert-unsafe-trait-obj.rs:17:17
18 |
29967ef6
XL
19LL | takes_trait(&S);
20 | ^^ `Trait` cannot be made into an object
21 |
22note: 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>
23 --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14
24 |
74b04a01 25LL | trait Trait: Sized {}
29967ef6 26 | ----- ^^^^^ ...because it requires `Self: Sized`
74b04a01
XL
27 | |
28 | this trait cannot be made into an object...
49aad941 29 = note: required for the cast from `&S` to `&dyn Trait`
e74abb32
XL
30
31error[E0038]: the trait `Trait` cannot be made into an object
32 --> $DIR/wf-convert-unsafe-trait-obj.rs:15:5
33 |
29967ef6
XL
34LL | &S as &dyn Trait;
35 | ^^ `Trait` cannot be made into an object
36 |
37note: 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>
38 --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14
39 |
74b04a01 40LL | trait Trait: Sized {}
29967ef6 41 | ----- ^^^^^ ...because it requires `Self: Sized`
74b04a01
XL
42 | |
43 | this trait cannot be made into an object...
49aad941 44 = note: required for the cast from `&S` to `&dyn Trait`
e74abb32
XL
45
46error: aborting due to 3 previous errors
47
48For more information about this error, try `rustc --explain E0038`.