fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.2 KiB34 linesraw
1error[E0658]: `match` is not allowed in a `const`
2  --> $DIR/match-test-ptr-null.rs:6:9
3   |
4LL | /         match &1 as *const i32 as usize {
5LL | |
6LL | |
7LL | |
8LL | |             0 => 42,
9LL | |             n => n,
10LL | |         }
11   | |_________^
12   |
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
15
16error[E0658]: casting pointers to integers in constants is unstable
17  --> $DIR/match-test-ptr-null.rs:6:15
18   |
19LL |         match &1 as *const i32 as usize {
20   |               ^^^^^^^^^^^^^^^^^^^^^^^^^
21   |
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
24
25error[E0080]: evaluation of constant value failed
26  --> $DIR/match-test-ptr-null.rs:6:15
27   |
28LL |         match &1 as *const i32 as usize {
29   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants
30
31error: aborting due to 3 previous errors
32
33Some errors have detailed explanations: E0080, E0658.
34For more information about an error, try `rustc --explain E0080`.