diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r-- | crates/ra_hir_ty/src/tests/never_type.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/never_type.rs b/crates/ra_hir_ty/src/tests/never_type.rs index c202f545a..a77209480 100644 --- a/crates/ra_hir_ty/src/tests/never_type.rs +++ b/crates/ra_hir_ty/src/tests/never_type.rs | |||
@@ -101,6 +101,7 @@ fn test() { | |||
101 | ); | 101 | ); |
102 | assert_eq!(t, "Option<i32>"); | 102 | assert_eq!(t, "Option<i32>"); |
103 | } | 103 | } |
104 | |||
104 | #[test] | 105 | #[test] |
105 | fn never_type_can_be_reinferred3() { | 106 | fn never_type_can_be_reinferred3() { |
106 | let t = type_at( | 107 | let t = type_at( |
@@ -138,6 +139,22 @@ fn test(a: Void) { | |||
138 | } | 139 | } |
139 | 140 | ||
140 | #[test] | 141 | #[test] |
142 | fn match_unknown_arm() { | ||
143 | let t = type_at( | ||
144 | r#" | ||
145 | //- /main.rs | ||
146 | fn test(a: Option) { | ||
147 | let t = match 0 { | ||
148 | _ => unknown, | ||
149 | }; | ||
150 | t<|>; | ||
151 | } | ||
152 | "#, | ||
153 | ); | ||
154 | assert_eq!(t, "{unknown}"); | ||
155 | } | ||
156 | |||
157 | #[test] | ||
141 | fn if_never() { | 158 | fn if_never() { |
142 | let t = type_at( | 159 | let t = type_at( |
143 | r#" | 160 | r#" |