Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/simple.rs')
-rw-r--r--crates/hir-ty/src/tests/simple.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/simple.rs b/crates/hir-ty/src/tests/simple.rs
index 1563660457..9e0920e41b 100644
--- a/crates/hir-ty/src/tests/simple.rs
+++ b/crates/hir-ty/src/tests/simple.rs
@@ -3814,3 +3814,31 @@ async fn foo(a: (), b: i32) -> u32 {
"#,
);
}
+
+#[test]
+fn irrefutable_slices() {
+ check_infer(
+ r#"
+//- minicore: from
+struct A;
+
+impl From<A> for [u8; 2] {
+ fn from(a: A) -> Self {
+ [0; 2]
+ }
+}
+impl From<A> for [u8; 3] {
+ fn from(a: A) -> Self {
+ [0; 3]
+ }
+}
+
+
+fn main() {
+ let a = A;
+ let [b, c] = a.into();
+}
+"#,
+ expect![],
+ );
+}