]>
Commit | Line | Data |
---|---|---|
60c5eb7d | 1 | warning: any use of this value will cause an error |
dfeec247 | 2 | --> $DIR/index-out-of-bounds-never-type.rs:10:61 |
60c5eb7d XL |
3 | | |
4 | LL | 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 | 9 | note: the lint level is defined here |
dfeec247 | 10 | --> $DIR/index-out-of-bounds-never-type.rs:4:9 |
60c5eb7d XL |
11 | | |
12 | LL | #![warn(const_err)] | |
13 | | ^^^^^^^^^ | |
14 | ||
15 | error: erroneous constant encountered | |
dfeec247 | 16 | --> $DIR/index-out-of-bounds-never-type.rs:15:13 |
60c5eb7d XL |
17 | | |
18 | LL | let _ = PrintName::<T>::VOID; | |
19 | | ^^^^^^^^^^^^^^^^^^^^ | |
20 | ||
ba9703b0 | 21 | error: aborting due to previous error; 1 warning emitted |
60c5eb7d | 22 |