diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 68 |
1 files changed, 5 insertions, 63 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 7fc9fbb63..e3eb0c3fa 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -3601,46 +3601,6 @@ mod branching_with_never_tests { | |||
3601 | use super::type_at; | 3601 | use super::type_at; |
3602 | 3602 | ||
3603 | #[test] | 3603 | #[test] |
3604 | fn match_first_arm_never() { | ||
3605 | let t = type_at( | ||
3606 | r#" | ||
3607 | //- /main.rs | ||
3608 | fn test(a: i32) { | ||
3609 | let i = match a { | ||
3610 | 1 => return, | ||
3611 | 2 => 2.0, | ||
3612 | 3 => loop {}, | ||
3613 | _ => 3.0, | ||
3614 | }; | ||
3615 | i<|> | ||
3616 | () | ||
3617 | } | ||
3618 | "#, | ||
3619 | ); | ||
3620 | assert_eq!(t, "f64"); | ||
3621 | } | ||
3622 | |||
3623 | #[test] | ||
3624 | fn match_second_block_arm_never() { | ||
3625 | let t = type_at( | ||
3626 | r#" | ||
3627 | //- /main.rs | ||
3628 | fn test(a: i32) { | ||
3629 | let i = match a { | ||
3630 | 1 => { 3.0 }, | ||
3631 | 2 => { loop {} }, | ||
3632 | 3 => { 3.0 }, | ||
3633 | _ => { return }, | ||
3634 | }; | ||
3635 | i<|> | ||
3636 | () | ||
3637 | } | ||
3638 | "#, | ||
3639 | ); | ||
3640 | assert_eq!(t, "f64"); | ||
3641 | } | ||
3642 | |||
3643 | #[test] | ||
3644 | fn if_never() { | 3604 | fn if_never() { |
3645 | let t = type_at( | 3605 | let t = type_at( |
3646 | r#" | 3606 | r#" |
@@ -3679,16 +3639,16 @@ fn test(input: bool) { | |||
3679 | } | 3639 | } |
3680 | 3640 | ||
3681 | #[test] | 3641 | #[test] |
3682 | fn match_first_block_arm_never() { | 3642 | fn match_first_arm_never() { |
3683 | let t = type_at( | 3643 | let t = type_at( |
3684 | r#" | 3644 | r#" |
3685 | //- /main.rs | 3645 | //- /main.rs |
3686 | fn test(a: i32) { | 3646 | fn test(a: i32) { |
3687 | let i = match a { | 3647 | let i = match a { |
3688 | 1 => { return }, | 3648 | 1 => return, |
3689 | 2 => { 2.0 }, | 3649 | 2 => 2.0, |
3690 | 3 => { loop {} }, | 3650 | 3 => loop {}, |
3691 | _ => { 3.0 }, | 3651 | _ => 3.0, |
3692 | }; | 3652 | }; |
3693 | i<|> | 3653 | i<|> |
3694 | () | 3654 | () |
@@ -3737,24 +3697,6 @@ fn test(a: i32) { | |||
3737 | } | 3697 | } |
3738 | 3698 | ||
3739 | #[test] | 3699 | #[test] |
3740 | fn match_all_block_arms_never() { | ||
3741 | let t = type_at( | ||
3742 | r#" | ||
3743 | //- /main.rs | ||
3744 | fn test(a: i32) { | ||
3745 | let i = match a { | ||
3746 | 2 => { return }, | ||
3747 | _ => { loop {} }, | ||
3748 | }; | ||
3749 | i<|> | ||
3750 | () | ||
3751 | } | ||
3752 | "#, | ||
3753 | ); | ||
3754 | assert_eq!(t, "!"); | ||
3755 | } | ||
3756 | |||
3757 | #[test] | ||
3758 | fn match_no_never_arms() { | 3700 | fn match_no_never_arms() { |
3759 | let t = type_at( | 3701 | let t = type_at( |
3760 | r#" | 3702 | r#" |