diff options
Diffstat (limited to 'crates/hir_ty/src/diagnostics/pattern.rs')
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics/pattern.rs b/crates/hir_ty/src/diagnostics/pattern.rs new file mode 100644 index 000000000..28c7a244d --- /dev/null +++ b/crates/hir_ty/src/diagnostics/pattern.rs | |||
@@ -0,0 +1,36 @@ | |||
1 | #![deny(elided_lifetimes_in_paths)] | ||
2 | #![allow(unused)] // todo remove | ||
3 | |||
4 | mod deconstruct_pat; | ||
5 | pub mod usefulness; | ||
6 | |||
7 | #[cfg(test)] | ||
8 | mod tests { | ||
9 | use crate::diagnostics::tests::check_diagnostics; | ||
10 | |||
11 | use super::*; | ||
12 | |||
13 | #[test] | ||
14 | fn unit_exhaustive() { | ||
15 | check_diagnostics( | ||
16 | r#" | ||
17 | fn main() { | ||
18 | match () { () => {} } | ||
19 | match () { _ => {} } | ||
20 | } | ||
21 | "#, | ||
22 | ); | ||
23 | } | ||
24 | |||
25 | #[test] | ||
26 | fn unit_non_exhaustive() { | ||
27 | check_diagnostics( | ||
28 | r#" | ||
29 | fn main() { | ||
30 | match () { } | ||
31 | //^^ Missing match arm | ||
32 | } | ||
33 | "#, | ||
34 | ); | ||
35 | } | ||
36 | } | ||