@@ -9,37 +9,28 @@ LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-re
9
9
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
10
10
= help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`
11
11
12
- error: indexing may panic
13
- --> $DIR/indexing_slicing_index.rs:16:24
14
- |
15
- LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
16
- | ^^^^^^^^^^^
17
- |
18
- = help: consider using `.get(n)` or `.get_mut(n)` instead
19
- = note: the suggestion might not be applicable in constant blocks
20
-
21
12
error[E0080]: evaluation of `main::{constant#3}` failed
22
- --> $DIR/indexing_slicing_index.rs:48 :14
13
+ --> $DIR/indexing_slicing_index.rs:46 :14
23
14
|
24
15
LL | const { &ARR[idx4()] };
25
16
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
26
17
27
18
note: erroneous constant encountered
28
- --> $DIR/indexing_slicing_index.rs:48 :5
19
+ --> $DIR/indexing_slicing_index.rs:46 :5
29
20
|
30
21
LL | const { &ARR[idx4()] };
31
22
| ^^^^^^^^^^^^^^^^^^^^^^
32
23
33
24
error: indexing may panic
34
- --> $DIR/indexing_slicing_index.rs:29 :5
25
+ --> $DIR/indexing_slicing_index.rs:27 :5
35
26
|
36
27
LL | x[index];
37
28
| ^^^^^^^^
38
29
|
39
30
= help: consider using `.get(n)` or `.get_mut(n)` instead
40
31
41
32
error: index is out of bounds
42
- --> $DIR/indexing_slicing_index.rs:32 :5
33
+ --> $DIR/indexing_slicing_index.rs:30 :5
43
34
|
44
35
LL | x[4];
45
36
| ^^^^
@@ -48,13 +39,13 @@ LL | x[4];
48
39
= help: to override `-D warnings` add `#[allow(clippy::out_of_bounds_indexing)]`
49
40
50
41
error: index is out of bounds
51
- --> $DIR/indexing_slicing_index.rs:34 :5
42
+ --> $DIR/indexing_slicing_index.rs:32 :5
52
43
|
53
44
LL | x[1 << 3];
54
45
| ^^^^^^^^^
55
46
56
47
error: indexing may panic
57
- --> $DIR/indexing_slicing_index.rs:45 :14
48
+ --> $DIR/indexing_slicing_index.rs:43 :14
58
49
|
59
50
LL | const { &ARR[idx()] };
60
51
| ^^^^^^^^^^
@@ -63,7 +54,7 @@ LL | const { &ARR[idx()] };
63
54
= note: the suggestion might not be applicable in constant blocks
64
55
65
56
error: indexing may panic
66
- --> $DIR/indexing_slicing_index.rs:48 :14
57
+ --> $DIR/indexing_slicing_index.rs:46 :14
67
58
|
68
59
LL | const { &ARR[idx4()] };
69
60
| ^^^^^^^^^^^
@@ -72,69 +63,63 @@ LL | const { &ARR[idx4()] };
72
63
= note: the suggestion might not be applicable in constant blocks
73
64
74
65
error: index is out of bounds
75
- --> $DIR/indexing_slicing_index.rs:55 :5
66
+ --> $DIR/indexing_slicing_index.rs:53 :5
76
67
|
77
68
LL | y[4];
78
69
| ^^^^
79
70
80
71
error: indexing may panic
81
- --> $DIR/indexing_slicing_index.rs:58 :5
72
+ --> $DIR/indexing_slicing_index.rs:56 :5
82
73
|
83
74
LL | v[0];
84
75
| ^^^^
85
76
|
86
77
= help: consider using `.get(n)` or `.get_mut(n)` instead
87
78
88
79
error: indexing may panic
89
- --> $DIR/indexing_slicing_index.rs:60 :5
80
+ --> $DIR/indexing_slicing_index.rs:58 :5
90
81
|
91
82
LL | v[10];
92
83
| ^^^^^
93
84
|
94
85
= help: consider using `.get(n)` or `.get_mut(n)` instead
95
86
96
87
error: indexing may panic
97
- --> $DIR/indexing_slicing_index.rs:62 :5
88
+ --> $DIR/indexing_slicing_index.rs:60 :5
98
89
|
99
90
LL | v[1 << 3];
100
91
| ^^^^^^^^^
101
92
|
102
93
= help: consider using `.get(n)` or `.get_mut(n)` instead
103
94
104
95
error: index is out of bounds
105
- --> $DIR/indexing_slicing_index.rs:70 :5
96
+ --> $DIR/indexing_slicing_index.rs:68 :5
106
97
|
107
98
LL | x[N];
108
99
| ^^^^
109
100
110
101
error: indexing may panic
111
- --> $DIR/indexing_slicing_index.rs:73 :5
102
+ --> $DIR/indexing_slicing_index.rs:71 :5
112
103
|
113
104
LL | v[N];
114
105
| ^^^^
115
106
|
116
107
= help: consider using `.get(n)` or `.get_mut(n)` instead
117
108
118
109
error: indexing may panic
119
- --> $DIR/indexing_slicing_index.rs:75 :5
110
+ --> $DIR/indexing_slicing_index.rs:73 :5
120
111
|
121
112
LL | v[M];
122
113
| ^^^^
123
114
|
124
115
= help: consider using `.get(n)` or `.get_mut(n)` instead
125
116
126
117
error: index is out of bounds
127
- --> $DIR/indexing_slicing_index.rs:79 :13
118
+ --> $DIR/indexing_slicing_index.rs:77 :13
128
119
|
129
120
LL | let _ = x[4];
130
121
| ^^^^
131
122
132
- error[E0080]: evaluation of constant value failed
133
- --> $DIR/indexing_slicing_index.rs:16:24
134
- |
135
- LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
136
- | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
137
-
138
- error: aborting due to 17 previous errors
123
+ error: aborting due to 15 previous errors
139
124
140
125
For more information about this error, try `rustc --explain E0080`.
0 commit comments