11error: indexing may panic
2- --> tests/ui/indexing_slicing_index.rs:15 :20
2+ --> tests/ui/indexing_slicing_index.rs:19 :20
33 |
44LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
55 | ^^^^^^^^^^
@@ -10,27 +10,27 @@ LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-re
1010 = help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`
1111
1212error[E0080]: evaluation of `main::{constant#3}` failed
13- --> tests/ui/indexing_slicing_index.rs:47 :14
13+ --> tests/ui/indexing_slicing_index.rs:67 :14
1414 |
1515LL | const { &ARR[idx4()] };
1616 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
1717
1818note: erroneous constant encountered
19- --> tests/ui/indexing_slicing_index.rs:47 :5
19+ --> tests/ui/indexing_slicing_index.rs:67 :5
2020 |
2121LL | const { &ARR[idx4()] };
2222 | ^^^^^^^^^^^^^^^^^^^^^^
2323
2424error: indexing may panic
25- --> tests/ui/indexing_slicing_index.rs:28 :5
25+ --> tests/ui/indexing_slicing_index.rs:48 :5
2626 |
2727LL | x[index];
2828 | ^^^^^^^^
2929 |
3030 = help: consider using `.get(n)` or `.get_mut(n)` instead
3131
3232error: index is out of bounds
33- --> tests/ui/indexing_slicing_index.rs:31 :5
33+ --> tests/ui/indexing_slicing_index.rs:51 :5
3434 |
3535LL | x[4];
3636 | ^^^^
@@ -39,13 +39,13 @@ LL | x[4];
3939 = help: to override `-D warnings` add `#[allow(clippy::out_of_bounds_indexing)]`
4040
4141error: index is out of bounds
42- --> tests/ui/indexing_slicing_index.rs:33 :5
42+ --> tests/ui/indexing_slicing_index.rs:53 :5
4343 |
4444LL | x[1 << 3];
4545 | ^^^^^^^^^
4646
4747error: indexing may panic
48- --> tests/ui/indexing_slicing_index.rs:44 :14
48+ --> tests/ui/indexing_slicing_index.rs:64 :14
4949 |
5050LL | const { &ARR[idx()] };
5151 | ^^^^^^^^^^
@@ -54,7 +54,7 @@ LL | const { &ARR[idx()] };
5454 = note: the suggestion might not be applicable in constant blocks
5555
5656error: indexing may panic
57- --> tests/ui/indexing_slicing_index.rs:47 :14
57+ --> tests/ui/indexing_slicing_index.rs:67 :14
5858 |
5959LL | const { &ARR[idx4()] };
6060 | ^^^^^^^^^^^
@@ -63,59 +63,59 @@ LL | const { &ARR[idx4()] };
6363 = note: the suggestion might not be applicable in constant blocks
6464
6565error: index is out of bounds
66- --> tests/ui/indexing_slicing_index.rs:54 :5
66+ --> tests/ui/indexing_slicing_index.rs:74 :5
6767 |
6868LL | y[4];
6969 | ^^^^
7070
7171error: indexing may panic
72- --> tests/ui/indexing_slicing_index.rs:57 :5
72+ --> tests/ui/indexing_slicing_index.rs:77 :5
7373 |
7474LL | v[0];
7575 | ^^^^
7676 |
7777 = help: consider using `.get(n)` or `.get_mut(n)` instead
7878
7979error: indexing may panic
80- --> tests/ui/indexing_slicing_index.rs:59 :5
80+ --> tests/ui/indexing_slicing_index.rs:79 :5
8181 |
8282LL | v[10];
8383 | ^^^^^
8484 |
8585 = help: consider using `.get(n)` or `.get_mut(n)` instead
8686
8787error: indexing may panic
88- --> tests/ui/indexing_slicing_index.rs:61 :5
88+ --> tests/ui/indexing_slicing_index.rs:81 :5
8989 |
9090LL | v[1 << 3];
9191 | ^^^^^^^^^
9292 |
9393 = help: consider using `.get(n)` or `.get_mut(n)` instead
9494
9595error: index is out of bounds
96- --> tests/ui/indexing_slicing_index.rs:69 :5
96+ --> tests/ui/indexing_slicing_index.rs:89 :5
9797 |
9898LL | x[N];
9999 | ^^^^
100100
101101error: indexing may panic
102- --> tests/ui/indexing_slicing_index.rs:72 :5
102+ --> tests/ui/indexing_slicing_index.rs:92 :5
103103 |
104104LL | v[N];
105105 | ^^^^
106106 |
107107 = help: consider using `.get(n)` or `.get_mut(n)` instead
108108
109109error: indexing may panic
110- --> tests/ui/indexing_slicing_index.rs:74 :5
110+ --> tests/ui/indexing_slicing_index.rs:94 :5
111111 |
112112LL | v[M];
113113 | ^^^^
114114 |
115115 = help: consider using `.get(n)` or `.get_mut(n)` instead
116116
117117error: index is out of bounds
118- --> tests/ui/indexing_slicing_index.rs:78 :13
118+ --> tests/ui/indexing_slicing_index.rs:98 :13
119119 |
120120LL | let _ = x[4];
121121 | ^^^^
0 commit comments