]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-eval/match-test-ptr-null.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / match-test-ptr-null.stderr
CommitLineData
60c5eb7d
XL
1error[E0658]: `match` is not allowed in a `const`
2 --> $DIR/match-test-ptr-null.rs:6:9
8faf50e0 3 |
60c5eb7d
XL
4LL | / match &1 as *const i32 as usize {
5LL | |
6LL | |
7LL | |
8LL | | 0 => 42,
9LL | | n => n,
10LL | | }
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 16error[E0658]: casting pointers to integers in constants is unstable
dc9dc135
XL
17 --> $DIR/match-test-ptr-null.rs:6:15
18 |
19LL | 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 25error[E0080]: evaluation of constant value failed
416331ca 26 --> $DIR/match-test-ptr-null.rs:6:15
8faf50e0 27 |
416331ca
XL
28LL | match &1 as *const i32 as usize {
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants
8faf50e0 30
60c5eb7d 31error: aborting due to 3 previous errors
8faf50e0 32
60c5eb7d
XL
33Some errors have detailed explanations: E0080, E0658.
34For more information about an error, try `rustc --explain E0080`.