]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/get_unwrap.stderr
Rollup merge of #103178 - ferrocene:pa-coverage-reports-tests, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / 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:35: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:5:9
9    |
10 LL | #![deny(clippy::get_unwrap)]
11    |         ^^^^^^^^^^^^^^^^^^
12
13 error: used `unwrap()` on `an Option` value
14   --> $DIR/get_unwrap.rs:35:17
15    |
16 LL |         let _ = boxed_slice.get(1).unwrap();
17    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
18    |
19    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
20    = note: `-D clippy::unwrap-used` implied by `-D warnings`
21
22 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
23   --> $DIR/get_unwrap.rs:36:17
24    |
25 LL |         let _ = some_slice.get(0).unwrap();
26    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
27
28 error: used `unwrap()` on `an Option` value
29   --> $DIR/get_unwrap.rs:36:17
30    |
31 LL |         let _ = some_slice.get(0).unwrap();
32    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
33    |
34    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
35
36 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
37   --> $DIR/get_unwrap.rs:37:17
38    |
39 LL |         let _ = some_vec.get(0).unwrap();
40    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
41
42 error: used `unwrap()` on `an Option` value
43   --> $DIR/get_unwrap.rs:37:17
44    |
45 LL |         let _ = some_vec.get(0).unwrap();
46    |                 ^^^^^^^^^^^^^^^^^^^^^^^^
47    |
48    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
49
50 error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
51   --> $DIR/get_unwrap.rs:38:17
52    |
53 LL |         let _ = some_vecdeque.get(0).unwrap();
54    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
55
56 error: used `unwrap()` on `an Option` value
57   --> $DIR/get_unwrap.rs:38:17
58    |
59 LL |         let _ = some_vecdeque.get(0).unwrap();
60    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61    |
62    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
63
64 error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
65   --> $DIR/get_unwrap.rs:39:17
66    |
67 LL |         let _ = some_hashmap.get(&1).unwrap();
68    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
69
70 error: used `unwrap()` on `an Option` value
71   --> $DIR/get_unwrap.rs:39:17
72    |
73 LL |         let _ = some_hashmap.get(&1).unwrap();
74    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75    |
76    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
77
78 error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
79   --> $DIR/get_unwrap.rs:40:17
80    |
81 LL |         let _ = some_btreemap.get(&1).unwrap();
82    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
83
84 error: used `unwrap()` on `an Option` value
85   --> $DIR/get_unwrap.rs:40:17
86    |
87 LL |         let _ = some_btreemap.get(&1).unwrap();
88    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89    |
90    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
91
92 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
93   --> $DIR/get_unwrap.rs:44:21
94    |
95 LL |         let _: u8 = *boxed_slice.get(1).unwrap();
96    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[1]`
97
98 error: used `unwrap()` on `an Option` value
99   --> $DIR/get_unwrap.rs:44:22
100    |
101 LL |         let _: u8 = *boxed_slice.get(1).unwrap();
102    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
103    |
104    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
105
106 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
107   --> $DIR/get_unwrap.rs:49:9
108    |
109 LL |         *boxed_slice.get_mut(0).unwrap() = 1;
110    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[0]`
111
112 error: used `unwrap()` on `an Option` value
113   --> $DIR/get_unwrap.rs:49:10
114    |
115 LL |         *boxed_slice.get_mut(0).unwrap() = 1;
116    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117    |
118    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
119
120 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
121   --> $DIR/get_unwrap.rs:50:9
122    |
123 LL |         *some_slice.get_mut(0).unwrap() = 1;
124    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_slice[0]`
125
126 error: used `unwrap()` on `an Option` value
127   --> $DIR/get_unwrap.rs:50:10
128    |
129 LL |         *some_slice.get_mut(0).unwrap() = 1;
130    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131    |
132    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
133
134 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
135   --> $DIR/get_unwrap.rs:51:9
136    |
137 LL |         *some_vec.get_mut(0).unwrap() = 1;
138    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0]`
139
140 error: used `unwrap()` on `an Option` value
141   --> $DIR/get_unwrap.rs:51:10
142    |
143 LL |         *some_vec.get_mut(0).unwrap() = 1;
144    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
145    |
146    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
147
148 error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
149   --> $DIR/get_unwrap.rs:52:9
150    |
151 LL |         *some_vecdeque.get_mut(0).unwrap() = 1;
152    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`
153
154 error: used `unwrap()` on `an Option` value
155   --> $DIR/get_unwrap.rs:52:10
156    |
157 LL |         *some_vecdeque.get_mut(0).unwrap() = 1;
158    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159    |
160    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
161
162 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
163   --> $DIR/get_unwrap.rs:64:17
164    |
165 LL |         let _ = some_vec.get(0..1).unwrap().to_vec();
166    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
167
168 error: used `unwrap()` on `an Option` value
169   --> $DIR/get_unwrap.rs:64:17
170    |
171 LL |         let _ = some_vec.get(0..1).unwrap().to_vec();
172    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
173    |
174    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
175
176 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
177   --> $DIR/get_unwrap.rs:65:17
178    |
179 LL |         let _ = some_vec.get_mut(0..1).unwrap().to_vec();
180    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
181
182 error: used `unwrap()` on `an Option` value
183   --> $DIR/get_unwrap.rs:65:17
184    |
185 LL |         let _ = some_vec.get_mut(0..1).unwrap().to_vec();
186    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
187    |
188    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
189
190 error: aborting due to 26 previous errors
191