mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
940c662654
- Changed lint category to `correctness` - Moved main function to bottom in test file - Added `FIXME` comment to `span_lint_and_sugg` to improve later
52 lines
1.4 KiB
Text
52 lines
1.4 KiB
Text
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:9:11
|
|
|
|
|
LL | match arr[idx] {
|
|
| ^^^^^^^^ help: try this: `arr.get(idx)`
|
|
|
|
|
= note: `-D clippy::match-on-vec-items` implied by `-D warnings`
|
|
|
|
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:16:11
|
|
|
|
|
LL | match arr[range] {
|
|
| ^^^^^^^^^^ help: try this: `arr.get(range)`
|
|
|
|
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:29:11
|
|
|
|
|
LL | match arr[idx] {
|
|
| ^^^^^^^^ help: try this: `arr.get(idx)`
|
|
|
|
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:36:11
|
|
|
|
|
LL | match arr[range] {
|
|
| ^^^^^^^^^^ help: try this: `arr.get(range)`
|
|
|
|
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:49:11
|
|
|
|
|
LL | match arr[idx] {
|
|
| ^^^^^^^^ help: try this: `arr.get(idx)`
|
|
|
|
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:56:11
|
|
|
|
|
LL | match arr[range] {
|
|
| ^^^^^^^^^^ help: try this: `arr.get(range)`
|
|
|
|
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:69:11
|
|
|
|
|
LL | match arr[idx] {
|
|
| ^^^^^^^^ help: try this: `arr.get(idx)`
|
|
|
|
error: indexing into a vector may panic
|
|
--> $DIR/match_on_vec_items.rs:76:11
|
|
|
|
|
LL | match arr[range] {
|
|
| ^^^^^^^^^^ help: try this: `arr.get(range)`
|
|
|
|
error: aborting due to 8 previous errors
|
|
|