rust/tests/ui/unnecessary_literal_unwrap.stderr

52 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-02-16 07:36:51 -06:00
error: used `unwrap()` on `Some` value
2023-02-16 08:37:18 -06:00
--> $DIR/unnecessary_literal_unwrap.rs:5:16
2023-02-16 07:36:51 -06:00
|
2023-02-16 08:37:18 -06:00
LL | let _val = Some(1).unwrap();
| ^^^^^^^^^^^^^^^^
2023-02-16 07:36:51 -06:00
|
= note: `-D clippy::unnecessary-literal-unwrap` implied by `-D warnings`
2023-02-16 08:21:43 -06:00
help: remove the `Some` and `unwrap()`
|
2023-02-16 08:37:18 -06:00
LL - let _val = Some(1).unwrap();
LL + let _val = 1;
2023-02-16 08:21:43 -06:00
|
2023-02-16 07:36:51 -06:00
2023-02-16 07:44:11 -06:00
error: used `expect()` on `Some` value
2023-02-16 08:37:18 -06:00
--> $DIR/unnecessary_literal_unwrap.rs:6:16
2023-02-16 07:44:11 -06:00
|
2023-02-16 08:37:18 -06:00
LL | let _val = Some(1).expect("this never happens");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-02-16 07:44:11 -06:00
|
2023-02-16 08:21:43 -06:00
help: remove the `Some` and `expect()`
|
2023-02-16 08:37:18 -06:00
LL - let _val = Some(1).expect("this never happens");
LL + let _val = 1;
2023-02-16 08:21:43 -06:00
|
2023-02-16 07:44:11 -06:00
2023-02-16 08:37:18 -06:00
error: used `unwrap()` on `Ok` value
--> $DIR/unnecessary_literal_unwrap.rs:10:16
|
LL | let _val = Ok::<usize, ()>(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove the `Ok` and `unwrap()`
|
LL - let _val = Ok::<usize, ()>(1).unwrap();
LL + let _val = 1;
|
error: used `expect()` on `Ok` value
--> $DIR/unnecessary_literal_unwrap.rs:11:16
|
LL | let _val = Ok::<usize, ()>(1).expect("this never happens");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove the `Ok` and `expect()`
|
LL - let _val = Ok::<usize, ()>(1).expect("this never happens");
LL + let _val = 1;
|
error: aborting due to 4 previous errors
2023-02-16 07:36:51 -06:00