Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/missing_match_arms.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/missing_match_arms.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ide-diagnostics/src/handlers/missing_match_arms.rs b/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
index c24430ce60..6594eed26d 100644
--- a/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
+++ b/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
@@ -273,15 +273,20 @@ enum Either2 { C, D }
fn main() {
match Either::A {
Either2::C => (),
+ // ^^^^^^^^^^ error: expected Either, found Either2
Either2::D => (),
+ // ^^^^^^^^^^ error: expected Either, found Either2
}
match (true, false) {
(true, false, true) => (),
+ // ^^^^^^^^^^^^^^^^^^^ error: expected (bool, bool), found (bool, bool, bool)
(true) => (),
// ^^^^ error: expected (bool, bool), found bool
}
match (true, false) { (true,) => {} }
+ // ^^^^^^^ error: expected (bool, bool), found (bool,)
match (0) { () => () }
+ // ^^ error: expected i32, found ()
match Unresolved::Bar { Unresolved::Baz => () }
}
"#,
@@ -295,7 +300,9 @@ fn main() {
r#"
fn main() {
match false { true | () => {} }
+ // ^^ error: expected bool, found ()
match (false,) { (true | (),) => {} }
+ // ^^ error: expected bool, found ()
}
"#,
);
@@ -1038,12 +1045,12 @@ fn main() {
#[test]
fn reference_patterns_in_fields() {
cov_mark::check_count!(validate_match_bailed_out, 2);
-
check_diagnostics(
r#"
fn main() {
match (&false,) {
(true,) => {}
+ // ^^^^^^^ error: expected (&bool,), found (bool,)
}
match (&false,) {
(&true,) => {}