|
| 1 | +error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<i32>` |
| 2 | + --> $DIR/type-checking-test-1.rs:12:13 |
| 3 | + | |
| 4 | +LL | let _ = x as &dyn Bar<i32>; // FIXME: OK, eventually |
| 5 | + | ^^^^^^^^^^^^^^^^^^ invalid cast |
| 6 | + | |
| 7 | +help: consider borrowing the value |
| 8 | + | |
| 9 | +LL | let _ = &x as &dyn Bar<i32>; // FIXME: OK, eventually |
| 10 | + | ^ |
| 11 | + |
| 12 | +error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<u32>` |
| 13 | + --> $DIR/type-checking-test-1.rs:15:13 |
| 14 | + | |
| 15 | +LL | let _ = x as &dyn Bar<u32>; // FIXME: OK, eventually |
| 16 | + | ^^^^^^^^^^^^^^^^^^ invalid cast |
| 17 | + | |
| 18 | +help: consider borrowing the value |
| 19 | + | |
| 20 | +LL | let _ = &x as &dyn Bar<u32>; // FIXME: OK, eventually |
| 21 | + | ^ |
| 22 | + |
| 23 | +error[E0277]: the trait bound `&dyn Foo: Bar<i32>` is not satisfied |
| 24 | + --> $DIR/type-checking-test-1.rs:12:13 |
| 25 | + | |
| 26 | +LL | let _ = x as &dyn Bar<i32>; // FIXME: OK, eventually |
| 27 | + | ^ the trait `Bar<i32>` is not implemented for `&dyn Foo` |
| 28 | + | |
| 29 | + = note: required for the cast to the object type `dyn Bar<i32>` |
| 30 | + |
| 31 | +error[E0277]: the trait bound `&dyn Foo: Bar<u32>` is not satisfied |
| 32 | + --> $DIR/type-checking-test-1.rs:15:13 |
| 33 | + | |
| 34 | +LL | let _ = x as &dyn Bar<u32>; // FIXME: OK, eventually |
| 35 | + | ^ the trait `Bar<u32>` is not implemented for `&dyn Foo` |
| 36 | + | |
| 37 | + = note: required for the cast to the object type `dyn Bar<u32>` |
| 38 | + |
| 39 | +error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<_>` |
| 40 | + --> $DIR/type-checking-test-1.rs:21:13 |
| 41 | + | |
| 42 | +LL | let _ = x as &dyn Bar<_>; // Ambiguous |
| 43 | + | ^^^^^^^^^^^^^^^^ invalid cast |
| 44 | + | |
| 45 | +help: consider borrowing the value |
| 46 | + | |
| 47 | +LL | let _ = &x as &dyn Bar<_>; // Ambiguous |
| 48 | + | ^ |
| 49 | + |
| 50 | +error[E0277]: the trait bound `&dyn Foo: Bar<_>` is not satisfied |
| 51 | + --> $DIR/type-checking-test-1.rs:21:13 |
| 52 | + | |
| 53 | +LL | let _ = x as &dyn Bar<_>; // Ambiguous |
| 54 | + | ^ the trait `Bar<_>` is not implemented for `&dyn Foo` |
| 55 | + | |
| 56 | + = note: required for the cast to the object type `dyn Bar<_>` |
| 57 | + |
| 58 | +error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<u32>` |
| 59 | + --> $DIR/type-checking-test-1.rs:27:13 |
| 60 | + | |
| 61 | +LL | let a = x as &dyn Bar<_>; // FIXME: OK, eventually |
| 62 | + | ^^^^^^^^^^^^^^^^ invalid cast |
| 63 | + | |
| 64 | +help: consider borrowing the value |
| 65 | + | |
| 66 | +LL | let a = &x as &dyn Bar<_>; // FIXME: OK, eventually |
| 67 | + | ^ |
| 68 | + |
| 69 | +error[E0277]: the trait bound `&dyn Foo: Bar<u32>` is not satisfied |
| 70 | + --> $DIR/type-checking-test-1.rs:27:13 |
| 71 | + | |
| 72 | +LL | let a = x as &dyn Bar<_>; // FIXME: OK, eventually |
| 73 | + | ^ the trait `Bar<u32>` is not implemented for `&dyn Foo` |
| 74 | + | |
| 75 | + = note: required for the cast to the object type `dyn Bar<u32>` |
| 76 | + |
| 77 | +error: aborting due to 8 previous errors |
| 78 | + |
| 79 | +Some errors have detailed explanations: E0277, E0605. |
| 80 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments