diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/missing_asserts_for_indexing_unfixable.stderr')
-rw-r--r-- | src/tools/clippy/tests/ui/missing_asserts_for_indexing_unfixable.stderr | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/tools/clippy/tests/ui/missing_asserts_for_indexing_unfixable.stderr b/src/tools/clippy/tests/ui/missing_asserts_for_indexing_unfixable.stderr index 12c9eed5d..12e054227 100644 --- a/src/tools/clippy/tests/ui/missing_asserts_for_indexing_unfixable.stderr +++ b/src/tools/clippy/tests/ui/missing_asserts_for_indexing_unfixable.stderr @@ -160,5 +160,24 @@ LL | let _ = f.v[0] + f.v[1]; | ^^^^^^ = note: asserting the length before indexing will elide bounds checks -error: aborting due to 7 previous errors +error: indexing into a slice multiple times without an `assert` + --> $DIR/missing_asserts_for_indexing_unfixable.rs:54:13 + | +LL | let _ = x[0] + x[1]; + | ^^^^^^^^^^^ + | + = help: consider asserting the length before indexing: `assert!(x.len() > 1);` +note: slice indexed here + --> $DIR/missing_asserts_for_indexing_unfixable.rs:54:13 + | +LL | let _ = x[0] + x[1]; + | ^^^^ +note: slice indexed here + --> $DIR/missing_asserts_for_indexing_unfixable.rs:54:20 + | +LL | let _ = x[0] + x[1]; + | ^^^^ + = note: asserting the length before indexing will elide bounds checks + +error: aborting due to 8 previous errors |