]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | error[E0658]: `match` is not allowed in a `const` |
2 | --> $DIR/match-test-ptr-null.rs:6:9 | |
8faf50e0 | 3 | | |
60c5eb7d XL |
4 | LL | / match &1 as *const i32 as usize { |
5 | LL | | | |
6 | LL | | | |
7 | LL | | | |
8 | LL | | 0 => 42, | |
9 | LL | | n => n, | |
10 | LL | | } | |
11 | | |_________^ | |
b7449926 | 12 | | |
60c5eb7d XL |
13 | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 |
14 | = help: add `#![feature(const_if_match)]` to the crate attributes to enable | |
8faf50e0 | 15 | |
60c5eb7d | 16 | error[E0658]: casting pointers to integers in constants is unstable |
dc9dc135 XL |
17 | --> $DIR/match-test-ptr-null.rs:6:15 |
18 | | | |
19 | LL | match &1 as *const i32 as usize { | |
20 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
8faf50e0 | 21 | | |
60c5eb7d XL |
22 | = note: for more information, see https://github.com/rust-lang/rust/issues/51910 |
23 | = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable | |
8faf50e0 | 24 | |
a1dfa0c6 | 25 | error[E0080]: evaluation of constant value failed |
416331ca | 26 | --> $DIR/match-test-ptr-null.rs:6:15 |
8faf50e0 | 27 | | |
416331ca XL |
28 | LL | match &1 as *const i32 as usize { |
29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants | |
8faf50e0 | 30 | |
60c5eb7d | 31 | error: aborting due to 3 previous errors |
8faf50e0 | 32 | |
60c5eb7d XL |
33 | Some errors have detailed explanations: E0080, E0658. |
34 | For more information about an error, try `rustc --explain E0080`. |