@@ -345,16 +345,34 @@ LL | if result.is_ok() {
345345LL | println!("{:?}", result.unwrap());
346346 | ^^^^^^^^^^^^^^^
347347
348+ error: called `unwrap` on `x` after checking its variant with `is_some`
349+ --> tests/ui/checked_unwrap/simple_conditionals.rs:299:9
350+ |
351+ LL | if x.is_some() {
352+ | -------------- help: try: `if let Some(<item>) = x`
353+ LL | borrow_option(&x);
354+ LL | x.unwrap();
355+ | ^^^^^^^^^^
356+
357+ error: called `unwrap` on `x` after checking its variant with `is_some`
358+ --> tests/ui/checked_unwrap/simple_conditionals.rs:305:9
359+ |
360+ LL | if x.is_some() {
361+ | -------------- help: try: `if let Some(<item>) = &x`
362+ LL | borrow_option(&x);
363+ LL | x.as_ref().unwrap();
364+ | ^^^^^^^^^^^^^^^^^^^
365+
348366error: called `unwrap` on `sopt.option` after checking its variant with `is_some`
349- --> tests/ui/checked_unwrap/simple_conditionals.rs:303 :9
367+ --> tests/ui/checked_unwrap/simple_conditionals.rs:321 :9
350368 |
351369LL | let _res = if sopt.option.is_some() {
352370 | ------------------------ help: try: `if let Some(<item>) = sopt.option`
353371LL | sopt.option.unwrap()
354372 | ^^^^^^^^^^^^^^^^^^^^
355373
356374error: this call to `unwrap()` will always panic
357- --> tests/ui/checked_unwrap/simple_conditionals.rs:306 :9
375+ --> tests/ui/checked_unwrap/simple_conditionals.rs:324 :9
358376 |
359377LL | let _res = if sopt.option.is_some() {
360378 | --------------------- because of this check
@@ -363,7 +381,7 @@ LL | sopt.option.unwrap()
363381 | ^^^^^^^^^^^^^^^^^^^^
364382
365383error: called `unwrap` on `sopt.option` after checking its variant with `is_some`
366- --> tests/ui/checked_unwrap/simple_conditionals.rs:312 :9
384+ --> tests/ui/checked_unwrap/simple_conditionals.rs:330 :9
367385 |
368386LL | let _res = if sopt.option.is_some() {
369387 | ------------------------ help: try: `if let Some(<item>) = sopt.option`
@@ -372,7 +390,7 @@ LL | sopt.option.unwrap()
372390 | ^^^^^^^^^^^^^^^^^^^^
373391
374392error: this call to `unwrap()` will always panic
375- --> tests/ui/checked_unwrap/simple_conditionals.rs:316 :9
393+ --> tests/ui/checked_unwrap/simple_conditionals.rs:334 :9
376394 |
377395LL | let _res = if sopt.option.is_some() {
378396 | --------------------- because of this check
@@ -381,15 +399,15 @@ LL | sopt.option.unwrap()
381399 | ^^^^^^^^^^^^^^^^^^^^
382400
383401error: called `unwrap` on `topt.0` after checking its variant with `is_some`
384- --> tests/ui/checked_unwrap/simple_conditionals.rs:340 :9
402+ --> tests/ui/checked_unwrap/simple_conditionals.rs:358 :9
385403 |
386404LL | let _res = if topt.0.is_some() {
387405 | ------------------- help: try: `if let Some(<item>) = topt.0`
388406LL | topt.0.unwrap()
389407 | ^^^^^^^^^^^^^^^
390408
391409error: this call to `unwrap()` will always panic
392- --> tests/ui/checked_unwrap/simple_conditionals.rs:343 :9
410+ --> tests/ui/checked_unwrap/simple_conditionals.rs:361 :9
393411 |
394412LL | let _res = if topt.0.is_some() {
395413 | ---------------- because of this check
@@ -398,7 +416,7 @@ LL | topt.0.unwrap()
398416 | ^^^^^^^^^^^^^^^
399417
400418error: called `unwrap` on `topt.0` after checking its variant with `is_some`
401- --> tests/ui/checked_unwrap/simple_conditionals.rs:349 :9
419+ --> tests/ui/checked_unwrap/simple_conditionals.rs:367 :9
402420 |
403421LL | let _res = if topt.0.is_some() {
404422 | ------------------- help: try: `if let Some(<item>) = topt.0`
@@ -407,7 +425,7 @@ LL | topt.0.unwrap()
407425 | ^^^^^^^^^^^^^^^
408426
409427error: this call to `unwrap()` will always panic
410- --> tests/ui/checked_unwrap/simple_conditionals.rs:353 :9
428+ --> tests/ui/checked_unwrap/simple_conditionals.rs:371 :9
411429 |
412430LL | let _res = if topt.0.is_some() {
413431 | ---------------- because of this check
@@ -416,15 +434,15 @@ LL | topt.0.unwrap()
416434 | ^^^^^^^^^^^^^^^
417435
418436error: called `unwrap` on `sopt2.option.option` after checking its variant with `is_some`
419- --> tests/ui/checked_unwrap/simple_conditionals.rs:387 :9
437+ --> tests/ui/checked_unwrap/simple_conditionals.rs:405 :9
420438 |
421439LL | let _res = if sopt2.option.option.is_some() {
422440 | -------------------------------- help: try: `if let Some(<item>) = sopt2.option.option`
423441LL | sopt2.option.option.unwrap()
424442 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
425443
426444error: this call to `unwrap()` will always panic
427- --> tests/ui/checked_unwrap/simple_conditionals.rs:390 :9
445+ --> tests/ui/checked_unwrap/simple_conditionals.rs:408 :9
428446 |
429447LL | let _res = if sopt2.option.option.is_some() {
430448 | ----------------------------- because of this check
@@ -433,7 +451,7 @@ LL | sopt2.option.option.unwrap()
433451 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
434452
435453error: called `unwrap` on `sopt2.option.option` after checking its variant with `is_some`
436- --> tests/ui/checked_unwrap/simple_conditionals.rs:397 :9
454+ --> tests/ui/checked_unwrap/simple_conditionals.rs:415 :9
437455 |
438456LL | let _res = if sopt2.option.option.is_some() {
439457 | -------------------------------- help: try: `if let Some(<item>) = sopt2.option.option`
@@ -442,7 +460,7 @@ LL | sopt2.option.option.unwrap()
442460 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
443461
444462error: this call to `unwrap()` will always panic
445- --> tests/ui/checked_unwrap/simple_conditionals.rs:401 :9
463+ --> tests/ui/checked_unwrap/simple_conditionals.rs:419 :9
446464 |
447465LL | let _res = if sopt2.option.option.is_some() {
448466 | ----------------------------- because of this check
@@ -451,7 +469,7 @@ LL | sopt2.option.option.unwrap()
451469 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
452470
453471error: called `unwrap` on `sopt2.option.option` after checking its variant with `is_some`
454- --> tests/ui/checked_unwrap/simple_conditionals.rs:407 :9
472+ --> tests/ui/checked_unwrap/simple_conditionals.rs:425 :9
455473 |
456474LL | let _res = if sopt2.option.option.is_some() {
457475 | -------------------------------- help: try: `if let Some(<item>) = sopt2.option.option`
@@ -460,13 +478,31 @@ LL | sopt2.option.option.unwrap()
460478 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
461479
462480error: this call to `unwrap()` will always panic
463- --> tests/ui/checked_unwrap/simple_conditionals.rs:411 :9
481+ --> tests/ui/checked_unwrap/simple_conditionals.rs:429 :9
464482 |
465483LL | let _res = if sopt2.option.option.is_some() {
466484 | ----------------------------- because of this check
467485...
468486LL | sopt2.option.option.unwrap()
469487 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
470488
471- error: aborting due to 53 previous errors
489+ error: called `unwrap` on `topt.0` after checking its variant with `is_some`
490+ --> tests/ui/checked_unwrap/simple_conditionals.rs:465:9
491+ |
492+ LL | if topt.0.is_some() {
493+ | ------------------- help: try: `if let Some(<item>) = topt.0`
494+ LL | borrow_toption(&topt);
495+ LL | topt.0.unwrap();
496+ | ^^^^^^^^^^^^^^^
497+
498+ error: called `unwrap` on `topt.0` after checking its variant with `is_some`
499+ --> tests/ui/checked_unwrap/simple_conditionals.rs:471:9
500+ |
501+ LL | if topt.0.is_some() {
502+ | ------------------- help: try: `if let Some(<item>) = &topt.0`
503+ LL | borrow_toption(&topt);
504+ LL | topt.0.as_ref().unwrap();
505+ | ^^^^^^^^^^^^^^^^^^^^^^^^
506+
507+ error: aborting due to 57 previous errors
472508
0 commit comments