Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs b/crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs
index 35cefd2397..f20b6dea12 100644
--- a/crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs
+++ b/crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs
@@ -106,4 +106,29 @@ fn test(x: Result<i32, &'static !>) {
"#,
);
}
+
+ #[test]
+ fn empty_patterns_normalize() {
+ check_diagnostics(
+ r#"
+enum Infallible {}
+
+trait Foo {
+ type Assoc;
+}
+enum Enum<T: Foo> {
+ A,
+ B(T::Assoc),
+}
+
+impl Foo for () {
+ type Assoc = Infallible;
+}
+
+fn foo(v: Enum<()>) {
+ let Enum::A = v;
+}
+ "#,
+ );
+ }
}