Document missing match arm false positive

This should already be guarded against
(d2212a49f6/crates/hir_ty/src/diagnostics/expr.rs (L225-L230))
but it isn't preventing this false positive for some reason.
This commit is contained in:
CAD97 2020-08-17 13:19:15 -04:00
parent 7d95a8447c
commit 2eaf79cfbb

View File

@ -1335,6 +1335,25 @@ fn panic(a: Category, b: Category) {
);
}
#[test]
fn unknown_type() {
check_diagnostics(
r#"
enum Option<T> { Some(T), None }
fn main() {
// FIXME: This is a false positive, as the `Never` type is not known here.
// `Never` is deliberately not defined so that it's an uninferred type.
match Option::<Never>::None {
None => (),
Some(never) => match never {},
// ^^^^^ Missing match arm
}
}
"#,
);
}
mod false_negatives {
//! The implementation of match checking here is a work in progress. As we roll this out, we
//! prefer false negatives to false positives (ideally there would be no false positives). This