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.rs24
1 files changed, 24 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 f20b6dea12..e31367f3b1 100644
--- a/crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs
+++ b/crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs
@@ -131,4 +131,28 @@ fn foo(v: Enum<()>) {
"#,
);
}
+
+ #[test]
+ fn regression_20259() {
+ check_diagnostics(
+ r#"
+//- minicore: deref
+use core::ops::Deref;
+
+struct Foo<T>(T);
+
+impl<T> Deref for Foo<T> {
+ type Target = T;
+
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+
+fn test(x: Foo<(i32, bool)>) {
+ let (_a, _b): &(i32, bool) = &x;
+}
+"#,
+ );
+ }
}