| error: called `unwrap` on `x` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:46:9 |
| | |
| LL | if x.is_some() { |
| | -------------- help: try: `if let Some(<item>) = x` |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| | |
| = note: `-D clippy::unnecessary-unwrap` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::unnecessary_unwrap)]` |
| |
| error: called `expect` on `x` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:49:9 |
| | |
| LL | if x.is_some() { |
| | -------------- help: try: `if let Some(<item>) = x` |
| ... |
| LL | x.expect("an error message"); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:52:9 |
| | |
| LL | if x.is_some() { |
| | ----------- because of this check |
| ... |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| | |
| = note: `-D clippy::panicking-unwrap` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::panicking_unwrap)]` |
| |
| error: this call to `expect()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:55:9 |
| | |
| LL | if x.is_some() { |
| | ----------- because of this check |
| ... |
| LL | x.expect("an error message"); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:59:9 |
| | |
| LL | if x.is_none() { |
| | ----------- because of this check |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: called `unwrap` on `x` after checking its variant with `is_none` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:62:9 |
| | |
| LL | if x.is_none() { |
| | -------------- help: try: `if let Some(<item>) = x` |
| ... |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: called `unwrap` on `x` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:13:13 |
| | |
| LL | if $a.is_some() { |
| | --------------- help: try: `if let Some(<item>) = x` |
| 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` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:71:9 |
| | |
| LL | if x.is_ok() { |
| | ------------ help: try: `if let Ok(<item>) = x` |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: called `expect` on `x` after checking its variant with `is_ok` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:74:9 |
| | |
| LL | if x.is_ok() { |
| | ------------ help: try: `if let Ok(<item>) = x` |
| ... |
| LL | x.expect("an error message"); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap_err()` will always panic |
| --> tests/ui/checked_unwrap/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 |
| --> tests/ui/checked_unwrap/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 |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:83: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` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:86:9 |
| | |
| LL | if x.is_ok() { |
| | ------------ help: try: `if let Err(<item>) = x` |
| ... |
| LL | x.unwrap_err(); |
| | ^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:90:9 |
| | |
| LL | if x.is_err() { |
| | ---------- because of this check |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: called `unwrap_err` on `x` after checking its variant with `is_err` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:93:9 |
| | |
| LL | if x.is_err() { |
| | ------------- help: try: `if let Err(<item>) = x` |
| ... |
| LL | x.unwrap_err(); |
| | ^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `x` after checking its variant with `is_err` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:96:9 |
| | |
| LL | if x.is_err() { |
| | ------------- help: try: `if let Ok(<item>) = x` |
| ... |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: this call to `unwrap_err()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:99:9 |
| | |
| LL | if x.is_err() { |
| | ---------- because of this check |
| ... |
| LL | x.unwrap_err(); |
| | ^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:124:9 |
| | |
| LL | if option.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = &option` |
| LL | option.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:127:9 |
| | |
| LL | if option.is_some() { |
| | ---------------- because of this check |
| ... |
| LL | option.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `result` after checking its variant with `is_ok` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:134:9 |
| | |
| LL | if result.is_ok() { |
| | ----------------- help: try: `if let Ok(<item>) = &result` |
| LL | result.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:137:9 |
| | |
| LL | if result.is_ok() { |
| | -------------- because of this check |
| ... |
| LL | result.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:143:9 |
| | |
| LL | if option.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = &mut option` |
| LL | option.as_mut().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:146:9 |
| | |
| LL | if option.is_some() { |
| | ---------------- because of this check |
| ... |
| LL | option.as_mut().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `result` after checking its variant with `is_ok` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:152:9 |
| | |
| LL | if result.is_ok() { |
| | ----------------- help: try: `if let Ok(<item>) = &mut result` |
| LL | result.as_mut().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:155:9 |
| | |
| LL | if result.is_ok() { |
| | -------------- because of this check |
| ... |
| LL | result.as_mut().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:184:17 |
| | |
| LL | if option.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = &option` |
| LL | let _ = option.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:187:17 |
| | |
| LL | if option.is_some() { |
| | ---------------- because of this check |
| ... |
| LL | let _ = option.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `result` after checking its variant with `is_ok` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:195:9 |
| | |
| LL | if result.is_ok() { |
| | ----------------- help: try: `if let Ok(<item>) = &result` |
| LL | let _y = 1; |
| LL | result.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:199:9 |
| | |
| LL | if result.is_ok() { |
| | -------------- because of this check |
| ... |
| LL | result.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `x` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:225:17 |
| | |
| LL | if x.is_some() { |
| | -------------- help: try: `if let Some(<item>) = x` |
| LL | _ = x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:228:17 |
| | |
| LL | if x.is_some() { |
| | ----------- because of this check |
| ... |
| LL | _ = x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: called `unwrap` on `r` after checking its variant with `is_ok` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:234:17 |
| | |
| LL | if r.is_ok() { |
| | ------------ help: try: `if let Ok(<item>) = &r` |
| LL | _ = r.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:237:17 |
| | |
| LL | if r.is_ok() { |
| | --------- because of this check |
| ... |
| LL | _ = r.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `x` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:246:17 |
| | |
| LL | if x.is_some() { |
| | -------------- help: try: `if let Some(<item>) = x` |
| LL | _ = x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:249:17 |
| | |
| LL | if x.is_some() { |
| | ----------- because of this check |
| ... |
| LL | _ = x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: called `unwrap` on `option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:259:26 |
| | |
| LL | if option.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = option` |
| LL | println!("{:?}", option.unwrap()); |
| | ^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:262:26 |
| | |
| LL | if option.is_some() { |
| | ---------------- because of this check |
| ... |
| LL | println!("{:?}", option.unwrap()); |
| | ^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `result` after checking its variant with `is_ok` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:269:26 |
| | |
| LL | if result.is_ok() { |
| | ----------------- help: try: `if let Ok(<item>) = result` |
| LL | println!("{:?}", result.unwrap()); |
| | ^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:272:26 |
| | |
| LL | if result.is_ok() { |
| | -------------- because of this check |
| ... |
| LL | println!("{:?}", result.unwrap()); |
| | ^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `x` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:299:9 |
| | |
| LL | if x.is_some() { |
| | -------------- help: try: `if let Some(<item>) = x` |
| LL | borrow_option(&x); |
| LL | x.unwrap(); |
| | ^^^^^^^^^^ |
| |
| error: called `unwrap` on `x` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:305:9 |
| | |
| LL | if x.is_some() { |
| | -------------- help: try: `if let Some(<item>) = &x` |
| LL | borrow_option(&x); |
| LL | x.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `sopt.option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:321:9 |
| | |
| LL | let _res = if sopt.option.is_some() { |
| | ------------------------ help: try: `if let Some(<item>) = sopt.option` |
| LL | sopt.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:324:9 |
| | |
| LL | let _res = if sopt.option.is_some() { |
| | --------------------- because of this check |
| ... |
| LL | sopt.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `sopt.option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:330:9 |
| | |
| LL | let _res = if sopt.option.is_some() { |
| | ------------------------ help: try: `if let Some(<item>) = sopt.option` |
| LL | sopt.other = false; |
| LL | sopt.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:334:9 |
| | |
| LL | let _res = if sopt.option.is_some() { |
| | --------------------- because of this check |
| ... |
| LL | sopt.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `topt.0` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:358:9 |
| | |
| LL | let _res = if topt.0.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = topt.0` |
| LL | topt.0.unwrap() |
| | ^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:361:9 |
| | |
| LL | let _res = if topt.0.is_some() { |
| | ---------------- because of this check |
| ... |
| LL | topt.0.unwrap() |
| | ^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `topt.0` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:367:9 |
| | |
| LL | let _res = if topt.0.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = topt.0` |
| LL | topt.1 = false; |
| LL | topt.0.unwrap() |
| | ^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:371:9 |
| | |
| LL | let _res = if topt.0.is_some() { |
| | ---------------- because of this check |
| ... |
| LL | topt.0.unwrap() |
| | ^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `sopt2.option.option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:405:9 |
| | |
| LL | let _res = if sopt2.option.option.is_some() { |
| | -------------------------------- help: try: `if let Some(<item>) = sopt2.option.option` |
| LL | sopt2.option.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:408:9 |
| | |
| LL | let _res = if sopt2.option.option.is_some() { |
| | ----------------------------- because of this check |
| ... |
| LL | sopt2.option.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `sopt2.option.option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:415:9 |
| | |
| LL | let _res = if sopt2.option.option.is_some() { |
| | -------------------------------- help: try: `if let Some(<item>) = sopt2.option.option` |
| LL | sopt2.other = false; |
| LL | sopt2.option.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:419:9 |
| | |
| LL | let _res = if sopt2.option.option.is_some() { |
| | ----------------------------- because of this check |
| ... |
| LL | sopt2.option.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `sopt2.option.option` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:425:9 |
| | |
| LL | let _res = if sopt2.option.option.is_some() { |
| | -------------------------------- help: try: `if let Some(<item>) = sopt2.option.option` |
| LL | sopt2.option.other = false; |
| LL | sopt2.option.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: this call to `unwrap()` will always panic |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:429:9 |
| | |
| LL | let _res = if sopt2.option.option.is_some() { |
| | ----------------------------- because of this check |
| ... |
| LL | sopt2.option.option.unwrap() |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `topt.0` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:465:9 |
| | |
| LL | if topt.0.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = topt.0` |
| LL | borrow_toption(&topt); |
| LL | topt.0.unwrap(); |
| | ^^^^^^^^^^^^^^^ |
| |
| error: called `unwrap` on `topt.0` after checking its variant with `is_some` |
| --> tests/ui/checked_unwrap/simple_conditionals.rs:471:9 |
| | |
| LL | if topt.0.is_some() { |
| | ------------------- help: try: `if let Some(<item>) = &topt.0` |
| LL | borrow_toption(&topt); |
| LL | topt.0.as_ref().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: aborting due to 57 previous errors |
| |