diff options
author | Dawer <[email protected]> | 2021-05-02 16:09:31 +0100 |
---|---|---|
committer | Dawer <[email protected]> | 2021-05-31 20:03:46 +0100 |
commit | 3a85e47f6ab586328ee17bb27e8dae3e3e247e23 (patch) | |
tree | 7767a3c7bc044573fe9f67fbc997254e48d32ec7 /crates/hir_ty/src/diagnostics/pattern.rs | |
parent | 5a8a0b62697c01ef881e7e2a0387e3649cab2034 (diff) |
Support bool literal patterns
Diffstat (limited to 'crates/hir_ty/src/diagnostics/pattern.rs')
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics/pattern.rs b/crates/hir_ty/src/diagnostics/pattern.rs index 3e90461cc..044506d66 100644 --- a/crates/hir_ty/src/diagnostics/pattern.rs +++ b/crates/hir_ty/src/diagnostics/pattern.rs | |||
@@ -121,4 +121,30 @@ fn main(v: E) { | |||
121 | "#, | 121 | "#, |
122 | ); | 122 | ); |
123 | } | 123 | } |
124 | |||
125 | #[test] | ||
126 | fn boolean() { | ||
127 | check_diagnostics( | ||
128 | r#" | ||
129 | fn main() { | ||
130 | match true { | ||
131 | true => {} | ||
132 | false => {} | ||
133 | } | ||
134 | match true { | ||
135 | true | false => {} | ||
136 | } | ||
137 | match true { | ||
138 | true => {} | ||
139 | _ => {} | ||
140 | } | ||
141 | match true {} | ||
142 | //^^^^ Missing match arm | ||
143 | match true { true => {} } | ||
144 | //^^^^ Missing match arm | ||
145 | |||
146 | } | ||
147 | "#, | ||
148 | ); | ||
149 | } | ||
124 | } | 150 | } |