]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/issue-20692.stderr
Rollup merge of #106835 - compiler-errors:new-solver-gat-rebase-oops, r=lcnr
[rust.git] / tests / ui / traits / issue-20692.stderr
1 error[E0038]: the trait `Array` cannot be made into an object
2   --> $DIR/issue-20692.rs:7:5
3    |
4 LL |     &dyn Array;
5    |     ^^^^^^^^^^ `Array` 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-20692.rs:1:14
9    |
10 LL | trait Array: Sized + Copy {}
11    |       -----  ^^^^^   ^^^^ ...because it requires `Self: Sized`
12    |       |      |
13    |       |      ...because it requires `Self: Sized`
14    |       this trait cannot be made into an object...
15
16 error[E0038]: the trait `Array` cannot be made into an object
17   --> $DIR/issue-20692.rs:4:13
18    |
19 LL |     let _ = x
20    |             ^ `Array` cannot be made into an object
21    |
22 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>
23   --> $DIR/issue-20692.rs:1:14
24    |
25 LL | trait Array: Sized + Copy {}
26    |       -----  ^^^^^   ^^^^ ...because it requires `Self: Sized`
27    |       |      |
28    |       |      ...because it requires `Self: Sized`
29    |       this trait cannot be made into an object...
30    = note: required for `&T` to implement `CoerceUnsized<&dyn Array>`
31    = note: required by cast to type `&dyn Array`
32
33 error: aborting due to 2 previous errors
34
35 For more information about this error, try `rustc --explain E0038`.