]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / traits / trait-upcasting / type-checking-test-1.stderr
1 error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<_>`
2 --> $DIR/type-checking-test-1.rs:17:13
3 |
4 LL | let _ = x as &dyn Bar<_>; // Ambiguous
5 | ^^^^^^^^^^^^^^^^ invalid cast
6 |
7 help: consider borrowing the value
8 |
9 LL | let _ = &x as &dyn Bar<_>; // Ambiguous
10 | +
11
12 error[E0277]: the trait bound `&dyn Foo: Bar<_>` is not satisfied
13 --> $DIR/type-checking-test-1.rs:17:13
14 |
15 LL | let _ = x as &dyn Bar<_>; // Ambiguous
16 | ^ the trait `Bar<_>` is not implemented for `&dyn Foo`
17 |
18 = note: required for the cast to the object type `dyn Bar<_>`
19
20 error: aborting due to 2 previous errors
21
22 Some errors have detailed explanations: E0277, E0605.
23 For more information about an error, try `rustc --explain E0277`.