]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / traits / trait-upcasting / type-checking-test-2.stderr
CommitLineData
94222f64
XL
1error[E0605]: non-primitive cast: `&dyn Foo<i32>` as `&dyn Bar<u32>`
2 --> $DIR/type-checking-test-2.rs:20:13
3 |
4LL | let _ = x as &dyn Bar<u32>; // Error
5 | ^^^^^^^^^^^^^^^^^^ invalid cast
6 |
7help: consider borrowing the value
8 |
9LL | let _ = &x as &dyn Bar<u32>; // Error
10 | +
11
12error[E0277]: the trait bound `&dyn Foo<i32>: Bar<u32>` is not satisfied
13 --> $DIR/type-checking-test-2.rs:20:13
14 |
15LL | let _ = x as &dyn Bar<u32>; // Error
16 | ^ the trait `Bar<u32>` is not implemented for `&dyn Foo<i32>`
17 |
064997fb 18 = note: required for the cast from `&dyn Foo<i32>` to the object type `dyn Bar<u32>`
94222f64
XL
19
20error[E0605]: non-primitive cast: `&dyn Foo<u32>` as `&dyn Bar<_>`
21 --> $DIR/type-checking-test-2.rs:26:13
22 |
23LL | let a = x as &dyn Bar<_>; // Ambiguous
24 | ^^^^^^^^^^^^^^^^ invalid cast
25 |
26help: consider borrowing the value
27 |
28LL | let a = &x as &dyn Bar<_>; // Ambiguous
29 | +
30
31error[E0277]: the trait bound `&dyn Foo<u32>: Bar<_>` is not satisfied
32 --> $DIR/type-checking-test-2.rs:26:13
33 |
34LL | let a = x as &dyn Bar<_>; // Ambiguous
35 | ^ the trait `Bar<_>` is not implemented for `&dyn Foo<u32>`
36 |
064997fb 37 = note: required for the cast from `&dyn Foo<u32>` to the object type `dyn Bar<_>`
94222f64
XL
38
39error: aborting due to 4 previous errors
40
41Some errors have detailed explanations: E0277, E0605.
42For more information about an error, try `rustc --explain E0277`.