]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / index-out-of-bounds-never-type.stderr
CommitLineData
60c5eb7d 1warning: any use of this value will cause an error
dfeec247 2 --> $DIR/index-out-of-bounds-never-type.rs:10:61
60c5eb7d
XL
3 |
4LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
5 | --------------------------------------------------------^^^^^---
6 | |
7 | index out of bounds: the len is 0 but the index is 0
8 |
74b04a01 9note: the lint level is defined here
dfeec247 10 --> $DIR/index-out-of-bounds-never-type.rs:4:9
60c5eb7d
XL
11 |
12LL | #![warn(const_err)]
13 | ^^^^^^^^^
14
15error: erroneous constant encountered
dfeec247 16 --> $DIR/index-out-of-bounds-never-type.rs:15:13
60c5eb7d
XL
17 |
18LL | let _ = PrintName::<T>::VOID;
19 | ^^^^^^^^^^^^^^^^^^^^
20
ba9703b0 21error: aborting due to previous error; 1 warning emitted
60c5eb7d 22