aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics/pattern.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/diagnostics/pattern.rs')
-rw-r--r--crates/hir_ty/src/diagnostics/pattern.rs36
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
index d98fb0867..38e4b53b7 100644
--- a/crates/hir_ty/src/diagnostics/pattern.rs
+++ b/crates/hir_ty/src/diagnostics/pattern.rs
@@ -511,4 +511,40 @@ fn main() {
511"#, 511"#,
512 ); 512 );
513 } 513 }
514
515 /// These failing tests are narrowed down from "hir_ty::diagnostics::match_check::tests"
516 // TODO fix
517 mod failing {
518 use super::*;
519
520 #[test]
521 fn never() {
522 check_diagnostics(
523 r#"
524enum Never {}
525
526fn enum_ref(never: &Never) {
527 match never {}
528}
529"#,
530 );
531 }
532
533 #[test]
534 fn unknown_type() {
535 check_diagnostics(
536 r#"
537enum Option<T> { Some(T), None }
538
539fn main() {
540 // `Never` is deliberately not defined so that it's an uninferred type.
541 match Option::<Never>::None {
542 None => {}
543 Some(never) => {}
544 }
545}
546"#,
547 );
548 }
549 }
514} 550}