aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics/pattern.rs
blob: 28c7a244d6378a6dc88a167e2b20b77e14c12beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#![deny(elided_lifetimes_in_paths)]
#![allow(unused)] // todo remove

mod deconstruct_pat;
pub mod usefulness;

#[cfg(test)]
mod tests {
    use crate::diagnostics::tests::check_diagnostics;

    use super::*;

    #[test]
    fn unit_exhaustive() {
        check_diagnostics(
            r#"
fn main() {
    match ()   { ()   => {} }
    match ()   { _    => {} }
}
"#,
        );
    }

    #[test]
    fn unit_non_exhaustive() {
        check_diagnostics(
            r#"
fn main() {
    match ()   {            }
        //^^ Missing match arm
}
"#,
        );
    }
}