]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/validate_never_arrays.stderr
Rollup merge of #72279 - RalfJung:raw-ref-macros, r=nikomatsakis
[rust.git] / src / test / ui / consts / validate_never_arrays.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/validate_never_arrays.rs:3:1
3    |
4 LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) };
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<deref>[0]
6    |
7    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
8
9 error[E0080]: it is undefined behavior to use this value
10   --> $DIR/validate_never_arrays.rs:6:1
11    |
12 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) };
13    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<deref>[0]
14    |
15    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
16
17 error[E0080]: it is undefined behavior to use this value
18   --> $DIR/validate_never_arrays.rs:7:1
19    |
20 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) };
21    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<deref>[0]
22    |
23    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
24
25 error: aborting due to 3 previous errors
26
27 For more information about this error, try `rustc --explain E0080`.