2023-04-21 21:58:55 +00:00
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:30:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v.len() < 5);
|
|
|
|
| -------------------- help: provide the highest index that is indexed with: `assert!(v.len() > 4)`
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:30:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:30:12
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:30:19
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:30:26
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:30:33
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
= note: `-D clippy::missing-asserts-for-indexing` implied by `-D warnings`
|
2023-09-07 19:43:06 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::missing_asserts_for_indexing)]`
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:36:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v.len() <= 5);
|
|
|
|
| --------------------- help: provide the highest index that is indexed with: `assert!(v.len() > 4)`
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:36:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:36:12
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:36:19
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:36:26
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:36:33
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:42:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v.len() > 3);
|
|
|
|
| -------------------- help: provide the highest index that is indexed with: `assert!(v.len() > 4)`
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:42:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:42:12
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:42:19
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:42:26
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:42:33
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:48:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v.len() >= 4);
|
|
|
|
| --------------------- help: provide the highest index that is indexed with: `assert!(v.len() > 4)`
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:48:5
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:48:12
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:48:19
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:48:26
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:48:33
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | v[0] + v[1] + v[2] + v[3] + v[4]
|
|
|
|
| ^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:66:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v.len() >= 3);
|
|
|
|
| --------------------- help: provide the highest index that is indexed with: `assert!(v.len() > 3)`
|
|
|
|
LL | let _ = v[0];
|
|
|
|
| _____________^
|
2023-08-31 16:42:27 +00:00
|
|
|
LL | |
|
2023-04-21 21:58:55 +00:00
|
|
|
LL | | let _ = v[1..4];
|
|
|
|
| |___________________^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:66:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v[0];
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:68:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v[1..4];
|
|
|
|
| ^^^^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:80:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v.len() >= 4);
|
|
|
|
| --------------------- help: provide the highest index that is indexed with: `assert!(v.len() > 4)`
|
|
|
|
LL | let _ = v[0];
|
|
|
|
| _____________^
|
2023-08-31 16:42:27 +00:00
|
|
|
LL | |
|
2023-04-21 21:58:55 +00:00
|
|
|
LL | | let _ = v[1..=4];
|
|
|
|
| |____________________^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:80:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v[0];
|
|
|
|
| ^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:82:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v[1..=4];
|
|
|
|
| ^^^^^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:95:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v1.len() >= 12);
|
|
|
|
| ----------------------- help: provide the highest index that is indexed with: `assert!(v1.len() > 12)`
|
2023-08-31 16:42:27 +00:00
|
|
|
LL | assert!(v2.len() >= 15);
|
2023-04-21 21:58:55 +00:00
|
|
|
LL | let _ = v1[0] + v1[12];
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:95:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v1[0] + v1[12];
|
|
|
|
| ^^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:95:21
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v1[0] + v1[12];
|
|
|
|
| ^^^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:97:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v2.len() >= 15);
|
|
|
|
| ----------------------- help: provide the highest index that is indexed with: `assert!(v2.len() > 15)`
|
|
|
|
...
|
|
|
|
LL | let _ = v2[5] + v2[15];
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:97:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v2[5] + v2[15];
|
|
|
|
| ^^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:97:21
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v2[5] + v2[15];
|
|
|
|
| ^^^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:103:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | assert!(v1.len() >= 12);
|
|
|
|
| ----------------------- help: provide the highest index that is indexed with: `assert!(v1.len() > 12)`
|
2023-08-31 16:42:27 +00:00
|
|
|
LL | assert!(v2.len() > 15);
|
2023-04-21 21:58:55 +00:00
|
|
|
LL | let _ = v1[0] + v1[12];
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:103:13
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v1[0] + v1[12];
|
|
|
|
| ^^^^^
|
|
|
|
note: slice indexed here
|
2023-08-31 16:42:27 +00:00
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:103:21
|
2023-04-21 21:58:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = v1[0] + v1[12];
|
|
|
|
| ^^^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
2023-11-18 13:59:24 +00:00
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:127:13
|
|
|
|
|
|
|
|
|
LL | assert!(v1.len() == 2);
|
|
|
|
| ---------------------- help: provide the highest index that is indexed with: `assert!(v1.len() == 3)`
|
|
|
|
...
|
|
|
|
LL | let _ = v1[0] + v1[1] + v1[2];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:127:13
|
|
|
|
|
|
|
|
|
LL | let _ = v1[0] + v1[1] + v1[2];
|
|
|
|
| ^^^^^
|
|
|
|
note: slice indexed here
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:127:21
|
|
|
|
|
|
|
|
|
LL | let _ = v1[0] + v1[1] + v1[2];
|
|
|
|
| ^^^^^
|
|
|
|
note: slice indexed here
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:127:29
|
|
|
|
|
|
|
|
|
LL | let _ = v1[0] + v1[1] + v1[2];
|
|
|
|
| ^^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: indexing into a slice multiple times with an `assert` that does not cover the highest index
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:131:13
|
|
|
|
|
|
|
|
|
LL | assert!(2 == v3.len());
|
|
|
|
| ---------------------- help: provide the highest index that is indexed with: `assert!(v3.len() == 3)`
|
|
|
|
...
|
|
|
|
LL | let _ = v3[0] + v3[1] + v3[2];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: slice indexed here
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:131:13
|
|
|
|
|
|
|
|
|
LL | let _ = v3[0] + v3[1] + v3[2];
|
|
|
|
| ^^^^^
|
|
|
|
note: slice indexed here
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:131:21
|
|
|
|
|
|
|
|
|
LL | let _ = v3[0] + v3[1] + v3[2];
|
|
|
|
| ^^^^^
|
|
|
|
note: slice indexed here
|
|
|
|
--> $DIR/missing_asserts_for_indexing.rs:131:29
|
|
|
|
|
|
|
|
|
LL | let _ = v3[0] + v3[1] + v3[2];
|
|
|
|
| ^^^^^
|
|
|
|
= note: asserting the length before indexing will elide bounds checks
|
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
2023-04-21 21:58:55 +00:00
|
|
|
|