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.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/crates/ide-diagnostics/src/handlers/missing_match_arms.rs b/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
index d52fc73870..7bc7955c4e 100644
--- a/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
+++ b/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
@@ -4,7 +4,7 @@ use crate::{Diagnostic, DiagnosticCode, DiagnosticsContext};
//
// This diagnostic is triggered if `match` block is missing one or more match arms.
pub(crate) fn missing_match_arms(
- ctx: &DiagnosticsContext<'_>,
+ ctx: &DiagnosticsContext<'_, '_>,
d: &hir::MissingMatchArms,
) -> Diagnostic {
Diagnostic::new_with_syntax_node_ptr(
@@ -300,7 +300,7 @@ fn main() {
}
match (true, false) {
(true, false, true) => (),
- //^^^^^^^^^^^^^^^^^^^ error: expected (bool, bool), found (bool, bool, bool)
+ //^^^^^^^^^^^^^^^^^^^ error: expected (bool, bool), found (bool, bool, {unknown})
(true) => (),
// ^^^^ error: expected (bool, bool), found bool
}
@@ -1198,4 +1198,20 @@ fn main() {
);
}
}
+
+ #[test]
+ fn no_overloaded_deref_is_not_projection() {
+ check_diagnostics(
+ r#"
+const FOO: &str = "";
+
+fn foo() {
+ match "" {
+ FOO => {}
+ _ => {}
+ }
+}
+ "#,
+ );
+ }
}