rust/tests/ui/unused_result_ok.stderr

53 lines
1.6 KiB
Plaintext
Raw Normal View History

2024-01-15 02:54:42 -06:00
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:9:5
|
LL | x.parse::<u32>().ok();
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-result-ok` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unused_result_ok)]`
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL | let _ = x.parse::<u32>();
| ~~~~~~~~~~~~~~~~~~~~~~~~
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:18:5
|
LL | x . parse::<i32>() . ok ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL | let _ = x . parse::<i32>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:34:5
|
LL | v!().ok();
| ^^^^^^^^^
|
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL | let _ = v!();
| ~~~~~~~~~~~~
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:29:9
|
LL | Ok::<(), ()>(()).ok();
| ^^^^^^^^^^^^^^^^^^^^^
...
LL | w!();
| ---- in this macro invocation
|
= note: this error originates in the macro `w` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL | let _ = Ok::<(), ()>(());
| ~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors