]> git.lizzy.rs Git - rust.git/blob - tests/ui/get_unwrap.stderr
Update references
[rust.git] / tests / ui / get_unwrap.stderr
1 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
2   --> $DIR/get_unwrap.rs:34:17
3    |
4 LL |         let _ = boxed_slice.get(1).unwrap();
5    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
6    |
7 note: the lint level is defined here
8   --> $DIR/get_unwrap.rs:3:9
9    |
10 LL | #![deny(clippy::get_unwrap)]
11    |         ^^^^^^^^^^^^^^^^^^
12
13 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
14   --> $DIR/get_unwrap.rs:35:17
15    |
16 LL |         let _ = some_slice.get(0).unwrap();
17    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
18
19 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
20   --> $DIR/get_unwrap.rs:36:17
21    |
22 LL |         let _ = some_vec.get(0).unwrap();
23    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
24
25 error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
26   --> $DIR/get_unwrap.rs:37:17
27    |
28 LL |         let _ = some_vecdeque.get(0).unwrap();
29    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
30
31 error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
32   --> $DIR/get_unwrap.rs:38:17
33    |
34 LL |         let _ = some_hashmap.get(&1).unwrap();
35    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
36
37 error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
38   --> $DIR/get_unwrap.rs:39:17
39    |
40 LL |         let _ = some_btreemap.get(&1).unwrap();
41    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
42
43 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
44   --> $DIR/get_unwrap.rs:42:21
45    |
46 LL |         let _: u8 = *boxed_slice.get(1).unwrap();
47    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[1]`
48
49 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
50   --> $DIR/get_unwrap.rs:47:9
51    |
52 LL |         *boxed_slice.get_mut(0).unwrap() = 1;
53    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[0]`
54
55 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
56   --> $DIR/get_unwrap.rs:48:9
57    |
58 LL |         *some_slice.get_mut(0).unwrap() = 1;
59    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_slice[0]`
60
61 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
62   --> $DIR/get_unwrap.rs:49:9
63    |
64 LL |         *some_vec.get_mut(0).unwrap() = 1;
65    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0]`
66
67 error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
68   --> $DIR/get_unwrap.rs:50:9
69    |
70 LL |         *some_vecdeque.get_mut(0).unwrap() = 1;
71    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`
72
73 error: non-binding let on a type that implements `Drop`
74   --> $DIR/get_unwrap.rs:59:9
75    |
76 LL |         let _ = some_vec.get(0..1).unwrap().to_vec();
77    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78    |
79    = note: `#[deny(clippy::let_underscore_drop)]` on by default
80    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
81
82 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
83   --> $DIR/get_unwrap.rs:59:17
84    |
85 LL |         let _ = some_vec.get(0..1).unwrap().to_vec();
86    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
87
88 error: non-binding let on a type that implements `Drop`
89   --> $DIR/get_unwrap.rs:60:9
90    |
91 LL |         let _ = some_vec.get_mut(0..1).unwrap().to_vec();
92    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93    |
94    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
95
96 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
97   --> $DIR/get_unwrap.rs:60:17
98    |
99 LL |         let _ = some_vec.get_mut(0..1).unwrap().to_vec();
100    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
101
102 error: aborting due to 15 previous errors
103