We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 055e7b7 commit e2ef0f7Copy full SHA for e2ef0f7
src/test/ui/issues/issue-54348.rs
@@ -0,0 +1,5 @@
1
+fn main() {
2
+ [1][0u64 as usize];
3
+ [1][1.5 as usize]; // ERROR index out of bounds
4
+ [1][1u64 as usize]; // ERROR index out of bounds
5
+}
src/test/ui/issues/issue-54348.stderr
@@ -0,0 +1,16 @@
+error: index out of bounds: the len is 1 but the index is 1
+ --> $DIR/issue-54348.rs:3:5
+ |
+LL | [1][1.5 as usize]; // ERROR index out of bounds
+ | ^^^^^^^^^^^^^^^^^
6
7
+ = note: #[deny(const_err)] on by default
8
+
9
10
+ --> $DIR/issue-54348.rs:4:5
11
12
+LL | [1][1u64 as usize]; // ERROR index out of bounds
13
+ | ^^^^^^^^^^^^^^^^^^
14
15
+error: aborting due to 2 previous errors
16
0 commit comments