]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/get_last_with_len.stderr
Auto merge of #101969 - reez12g:issue-101306, r=reez12g
[rust.git] / src / tools / clippy / tests / ui / get_last_with_len.stderr
1 error: accessing last element with `x.get(x.len() - 1)`
2   --> $DIR/get_last_with_len.rs:10:13
3    |
4 LL |     let _ = x.get(x.len() - 1);
5    |             ^^^^^^^^^^^^^^^^^^ help: try: `x.last()`
6    |
7    = note: `-D clippy::get-last-with-len` implied by `-D warnings`
8
9 error: accessing last element with `s.field.get(s.field.len() - 1)`
10   --> $DIR/get_last_with_len.rs:34:13
11    |
12 LL |     let _ = s.field.get(s.field.len() - 1);
13    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `s.field.last()`
14
15 error: accessing last element with `slice.get(slice.len() - 1)`
16   --> $DIR/get_last_with_len.rs:39:13
17    |
18 LL |     let _ = slice.get(slice.len() - 1);
19    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice.last()`
20
21 error: accessing last element with `array.get(array.len() - 1)`
22   --> $DIR/get_last_with_len.rs:42:13
23    |
24 LL |     let _ = array.get(array.len() - 1);
25    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `array.last()`
26
27 error: accessing last element with `deq.get(deq.len() - 1)`
28   --> $DIR/get_last_with_len.rs:45:13
29    |
30 LL |     let _ = deq.get(deq.len() - 1);
31    |             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `deq.back()`
32
33 error: accessing last element with `nested[0].get(nested[0].len() - 1)`
34   --> $DIR/get_last_with_len.rs:48:13
35    |
36 LL |     let _ = nested[0].get(nested[0].len() - 1);
37    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `nested[0].last()`
38
39 error: aborting due to 6 previous errors
40