|
| 1 | +error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `isize` |
| 2 | + --> $DIR/enum-to-numeric-cast.rs:42:13 |
| 3 | + | |
| 4 | +LL | let _ = not_unit_only_or_fieldless as isize; |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less |
| 6 | + | |
| 7 | + = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information |
| 8 | + |
| 9 | +error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `i32` |
| 10 | + --> $DIR/enum-to-numeric-cast.rs:43:13 |
| 11 | + | |
| 12 | +LL | let _ = not_unit_only_or_fieldless as i32; |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less |
| 14 | + | |
| 15 | + = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information |
| 16 | + |
| 17 | +error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `usize` |
| 18 | + --> $DIR/enum-to-numeric-cast.rs:44:13 |
| 19 | + | |
| 20 | +LL | let _ = not_unit_only_or_fieldless as usize; |
| 21 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less |
| 22 | + | |
| 23 | + = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information |
| 24 | + |
| 25 | +error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `u32` |
| 26 | + --> $DIR/enum-to-numeric-cast.rs:45:13 |
| 27 | + | |
| 28 | +LL | let _ = not_unit_only_or_fieldless as u32; |
| 29 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less |
| 30 | + | |
| 31 | + = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information |
| 32 | + |
| 33 | +error: aborting due to 4 previous errors |
| 34 | + |
| 35 | +For more information about this error, try `rustc --explain E0605`. |
0 commit comments