1
1
error: indexing may panic
2
2
--> $DIR/indexing_slicing_index.rs:9:20
3
3
|
4
- LL | const REF: &i32 = &ARR[idx()]; // This is should be linted, since `suppress-restriction-lint-in-const` default is false.
4
+ LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
5
5
| ^^^^^^^^^^
6
6
|
7
7
= help: consider using `.get(n)` or `.get_mut(n)` instead
@@ -20,13 +20,13 @@ LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
20
20
error[E0080]: evaluation of `main::{constant#3}` failed
21
21
--> $DIR/indexing_slicing_index.rs:31:14
22
22
|
23
- LL | const { &ARR[idx4()] }; // This is should be linted, since `suppress-restriction-lint-in-const` default is false.
23
+ LL | const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
24
24
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
25
25
26
26
note: erroneous constant used
27
27
--> $DIR/indexing_slicing_index.rs:31:5
28
28
|
29
- LL | const { &ARR[idx4()] }; // This is should be linted, since `suppress-restriction-lint-in-const` default is false.
29
+ LL | const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
30
30
| ^^^^^^^^^^^^^^^^^^^^^^
31
31
32
32
error: indexing may panic
@@ -56,7 +56,7 @@ LL | x[const { idx4() }]; // Ok, let rustc's `unconditional_panic` lint hand
56
56
error: indexing may panic
57
57
--> $DIR/indexing_slicing_index.rs:30:14
58
58
|
59
- LL | const { &ARR[idx()] }; // This is should be linted, since `suppress-restriction-lint-in-const` default is false.
59
+ LL | const { &ARR[idx()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
60
60
| ^^^^^^^^^^
61
61
|
62
62
= help: consider using `.get(n)` or `.get_mut(n)` instead
@@ -65,7 +65,7 @@ LL | const { &ARR[idx()] }; // This is should be linted, since `suppress-res
65
65
error: indexing may panic
66
66
--> $DIR/indexing_slicing_index.rs:31:14
67
67
|
68
- LL | const { &ARR[idx4()] }; // This is should be linted, since `suppress-restriction-lint-in-const` default is false.
68
+ LL | const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
69
69
| ^^^^^^^^^^^
70
70
|
71
71
= help: consider using `.get(n)` or `.get_mut(n)` instead
0 commit comments