]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/issue-38604.stderr
Rollup merge of #100112 - RalfJung:assert_send_and_sync, r=m-ou-se
[rust.git] / src / test / ui / traits / issue-38604.stderr
1 error[E0038]: the trait `Foo` cannot be made into an object
2   --> $DIR/issue-38604.rs:14:13
3    |
4 LL |     let _f: Box<dyn Foo> =
5    |             ^^^^^^^^^^^^ `Foo` cannot be made into an object
6    |
7 note: 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/issue-38604.rs:2:22
9    |
10 LL | trait Foo where u32: Q<Self> {
11    |       ---            ^^^^^^^ ...because it uses `Self` as a type parameter
12    |       |
13    |       this trait cannot be made into an object...
14
15 error[E0038]: the trait `Foo` cannot be made into an object
16   --> $DIR/issue-38604.rs:15:9
17    |
18 LL |         Box::new(());
19    |         ^^^^^^^^^^^^ `Foo` cannot be made into an object
20    |
21 note: 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>
22   --> $DIR/issue-38604.rs:2:22
23    |
24 LL | trait Foo where u32: Q<Self> {
25    |       ---            ^^^^^^^ ...because it uses `Self` as a type parameter
26    |       |
27    |       this trait cannot be made into an object...
28    = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Foo>>` for `Box<()>`
29    = note: required by cast to type `Box<dyn Foo>`
30
31 error: aborting due to 2 previous errors
32
33 For more information about this error, try `rustc --explain E0038`.