about summary refs log tree commit diff
path: root/tests/ui/autoref-autoderef/deref-into-array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/autoref-autoderef/deref-into-array.rs')
-rw-r--r--tests/ui/autoref-autoderef/deref-into-array.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/autoref-autoderef/deref-into-array.rs b/tests/ui/autoref-autoderef/deref-into-array.rs
new file mode 100644
index 00000000000..855a82d2f9c
--- /dev/null
+++ b/tests/ui/autoref-autoderef/deref-into-array.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+struct Test<T>([T; 1]);
+
+impl<T> std::ops::Deref for Test<T> {
+    type Target = [T; 1];
+
+    fn deref(&self) -> &[T; 1] {
+        &self.0
+    }
+}
+
+fn main() {
+    let out = Test([(); 1]);
+    let blah = out.len();
+    println!("{}", blah);
+}