1
1
error: indexing may panic
2
- --> tests/ui/indexing_slicing_index.rs:15 :20
2
+ --> tests/ui/indexing_slicing_index.rs:19 :20
3
3
|
4
4
LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
5
5
| ^^^^^^^^^^
@@ -10,27 +10,27 @@ LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-re
10
10
= help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`
11
11
12
12
error[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
14
14
|
15
15
LL | const { &ARR[idx4()] };
16
16
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
17
17
18
18
note: erroneous constant encountered
19
- --> tests/ui/indexing_slicing_index.rs:47 :5
19
+ --> tests/ui/indexing_slicing_index.rs:67 :5
20
20
|
21
21
LL | const { &ARR[idx4()] };
22
22
| ^^^^^^^^^^^^^^^^^^^^^^
23
23
24
24
error: indexing may panic
25
- --> tests/ui/indexing_slicing_index.rs:28 :5
25
+ --> tests/ui/indexing_slicing_index.rs:48 :5
26
26
|
27
27
LL | x[index];
28
28
| ^^^^^^^^
29
29
|
30
30
= help: consider using `.get(n)` or `.get_mut(n)` instead
31
31
32
32
error: index is out of bounds
33
- --> tests/ui/indexing_slicing_index.rs:31 :5
33
+ --> tests/ui/indexing_slicing_index.rs:51 :5
34
34
|
35
35
LL | x[4];
36
36
| ^^^^
@@ -39,13 +39,13 @@ LL | x[4];
39
39
= help: to override `-D warnings` add `#[allow(clippy::out_of_bounds_indexing)]`
40
40
41
41
error: index is out of bounds
42
- --> tests/ui/indexing_slicing_index.rs:33 :5
42
+ --> tests/ui/indexing_slicing_index.rs:53 :5
43
43
|
44
44
LL | x[1 << 3];
45
45
| ^^^^^^^^^
46
46
47
47
error: indexing may panic
48
- --> tests/ui/indexing_slicing_index.rs:44 :14
48
+ --> tests/ui/indexing_slicing_index.rs:64 :14
49
49
|
50
50
LL | const { &ARR[idx()] };
51
51
| ^^^^^^^^^^
@@ -54,7 +54,7 @@ LL | const { &ARR[idx()] };
54
54
= note: the suggestion might not be applicable in constant blocks
55
55
56
56
error: indexing may panic
57
- --> tests/ui/indexing_slicing_index.rs:47 :14
57
+ --> tests/ui/indexing_slicing_index.rs:67 :14
58
58
|
59
59
LL | const { &ARR[idx4()] };
60
60
| ^^^^^^^^^^^
@@ -63,59 +63,59 @@ LL | const { &ARR[idx4()] };
63
63
= note: the suggestion might not be applicable in constant blocks
64
64
65
65
error: index is out of bounds
66
- --> tests/ui/indexing_slicing_index.rs:54 :5
66
+ --> tests/ui/indexing_slicing_index.rs:74 :5
67
67
|
68
68
LL | y[4];
69
69
| ^^^^
70
70
71
71
error: indexing may panic
72
- --> tests/ui/indexing_slicing_index.rs:57 :5
72
+ --> tests/ui/indexing_slicing_index.rs:77 :5
73
73
|
74
74
LL | v[0];
75
75
| ^^^^
76
76
|
77
77
= help: consider using `.get(n)` or `.get_mut(n)` instead
78
78
79
79
error: indexing may panic
80
- --> tests/ui/indexing_slicing_index.rs:59 :5
80
+ --> tests/ui/indexing_slicing_index.rs:79 :5
81
81
|
82
82
LL | v[10];
83
83
| ^^^^^
84
84
|
85
85
= help: consider using `.get(n)` or `.get_mut(n)` instead
86
86
87
87
error: indexing may panic
88
- --> tests/ui/indexing_slicing_index.rs:61 :5
88
+ --> tests/ui/indexing_slicing_index.rs:81 :5
89
89
|
90
90
LL | v[1 << 3];
91
91
| ^^^^^^^^^
92
92
|
93
93
= help: consider using `.get(n)` or `.get_mut(n)` instead
94
94
95
95
error: index is out of bounds
96
- --> tests/ui/indexing_slicing_index.rs:69 :5
96
+ --> tests/ui/indexing_slicing_index.rs:89 :5
97
97
|
98
98
LL | x[N];
99
99
| ^^^^
100
100
101
101
error: indexing may panic
102
- --> tests/ui/indexing_slicing_index.rs:72 :5
102
+ --> tests/ui/indexing_slicing_index.rs:92 :5
103
103
|
104
104
LL | v[N];
105
105
| ^^^^
106
106
|
107
107
= help: consider using `.get(n)` or `.get_mut(n)` instead
108
108
109
109
error: indexing may panic
110
- --> tests/ui/indexing_slicing_index.rs:74 :5
110
+ --> tests/ui/indexing_slicing_index.rs:94 :5
111
111
|
112
112
LL | v[M];
113
113
| ^^^^
114
114
|
115
115
= help: consider using `.get(n)` or `.get_mut(n)` instead
116
116
117
117
error: index is out of bounds
118
- --> tests/ui/indexing_slicing_index.rs:78 :13
118
+ --> tests/ui/indexing_slicing_index.rs:98 :13
119
119
|
120
120
LL | let _ = x[4];
121
121
| ^^^^
0 commit comments