rust-clippy/tests/ui/match_on_vec_items.stderr

53 lines
1.4 KiB
Text
Raw Normal View History

error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:10:11
2020-04-23 21:28:18 +00:00
|
LL | match arr[idx] {
| ^^^^^^^^ help: try this: `arr.get(idx)`
2020-04-23 21:28:18 +00:00
|
2020-04-25 08:33:40 +00:00
= note: `-D clippy::match-on-vec-items` implied by `-D warnings`
2020-04-23 21:28:18 +00:00
error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:17:11
2020-04-23 21:28:18 +00:00
|
LL | match arr[range] {
| ^^^^^^^^^^ help: try this: `arr.get(range)`
error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:30:11
|
LL | match arr[idx] {
| ^^^^^^^^ help: try this: `arr.get(idx)`
error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:37:11
|
LL | match arr[range] {
| ^^^^^^^^^^ help: try this: `arr.get(range)`
error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:50:11
|
LL | match arr[idx] {
| ^^^^^^^^ help: try this: `arr.get(idx)`
error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:57:11
|
LL | match arr[range] {
| ^^^^^^^^^^ help: try this: `arr.get(range)`
error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:70:11
|
LL | match arr[idx] {
| ^^^^^^^^ help: try this: `arr.get(idx)`
error: indexing into a vector may panic
2023-06-06 20:56:57 +00:00
--> $DIR/match_on_vec_items.rs:77:11
2020-04-23 21:28:18 +00:00
|
LL | match arr[range] {
| ^^^^^^^^^^ help: try this: `arr.get(range)`
2020-04-23 21:28:18 +00:00
error: aborting due to 8 previous errors
2020-04-23 21:28:18 +00:00