about summary refs log tree commit diff
path: root/tests/ui/cast/enum-to-numeric-cast.stderr
blob: 1a49cb97451ce38689b77897c25f218fde183bba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `isize`
  --> $DIR/enum-to-numeric-cast.rs:42:13
   |
LL |     let _ = not_unit_only_or_fieldless as isize;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less
   |
   = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information

error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `i32`
  --> $DIR/enum-to-numeric-cast.rs:43:13
   |
LL |     let _ = not_unit_only_or_fieldless as i32;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less
   |
   = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information

error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `usize`
  --> $DIR/enum-to-numeric-cast.rs:44:13
   |
LL |     let _ = not_unit_only_or_fieldless as usize;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less
   |
   = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information

error[E0605]: non-primitive cast: `NotUnitOnlyOrFieldless` as `u32`
  --> $DIR/enum-to-numeric-cast.rs:45:13
   |
LL |     let _ = not_unit_only_or_fieldless as u32;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less
   |
   = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0605`.