rust/tests/ui/checked_unwrap/simple_conditionals.stderr
2023-08-22 17:17:48 +02:00

173 lines
4.8 KiB
Plaintext

error: called `unwrap` on `x` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:47:9
|
LL | if x.is_some() {
| -------------- help: try: `if let Some(..) = x`
LL | // unnecessary
LL | x.unwrap();
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/simple_conditionals.rs:3:35
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: called `expect` on `x` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:49:9
|
LL | if x.is_some() {
| -------------- help: try: `if let Some(..) = x`
...
LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:52:9
|
LL | if x.is_some() {
| ----------- because of this check
...
LL | x.unwrap();
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/simple_conditionals.rs:3:9
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `expect()` will always panic
--> $DIR/simple_conditionals.rs:54:9
|
LL | if x.is_some() {
| ----------- because of this check
...
LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:58:9
|
LL | if x.is_none() {
| ----------- because of this check
LL | // will panic
LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap` on `x` after checking its variant with `is_none`
--> $DIR/simple_conditionals.rs:61:9
|
LL | if x.is_none() {
| -------------- help: try: `if let Some(..) = x`
...
LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap` on `x` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:14:13
|
LL | if $a.is_some() {
| --------------- help: try: `if let Some(..) = x`
LL | // unnecessary
LL | $a.unwrap();
| ^^^^^^^^^^^
...
LL | m!(x);
| ----- in this macro invocation
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: called `unwrap` on `x` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:73:9
|
LL | if x.is_ok() {
| ------------ help: try: `if let Ok(..) = x`
LL | // unnecessary
LL | x.unwrap();
| ^^^^^^^^^^
error: called `expect` on `x` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:75:9
|
LL | if x.is_ok() {
| ------------ help: try: `if let Ok(..) = x`
...
LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap_err()` will always panic
--> $DIR/simple_conditionals.rs:77:9
|
LL | if x.is_ok() {
| --------- because of this check
...
LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:80:9
|
LL | if x.is_ok() {
| --------- because of this check
...
LL | x.unwrap();
| ^^^^^^^^^^
error: this call to `expect()` will always panic
--> $DIR/simple_conditionals.rs:82:9
|
LL | if x.is_ok() {
| --------- because of this check
...
LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:84:9
|
LL | if x.is_ok() {
| ------------ help: try: `if let Err(..) = x`
...
LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:88:9
|
LL | if x.is_err() {
| ---------- because of this check
LL | // will panic
LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_err`
--> $DIR/simple_conditionals.rs:90:9
|
LL | if x.is_err() {
| ------------- help: try: `if let Err(..) = x`
...
LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: called `unwrap` on `x` after checking its variant with `is_err`
--> $DIR/simple_conditionals.rs:93:9
|
LL | if x.is_err() {
| ------------- help: try: `if let Ok(..) = x`
...
LL | x.unwrap();
| ^^^^^^^^^^
error: this call to `unwrap_err()` will always panic
--> $DIR/simple_conditionals.rs:95:9
|
LL | if x.is_err() {
| ---------- because of this check
...
LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: aborting due to 17 previous errors