summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-40402-ref-hints/issue-40402-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-40402-ref-hints/issue-40402-2.rs')
-rw-r--r--tests/ui/issues/issue-40402-ref-hints/issue-40402-2.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-40402-ref-hints/issue-40402-2.rs b/tests/ui/issues/issue-40402-ref-hints/issue-40402-2.rs
new file mode 100644
index 000000000..1fb6e31e9
--- /dev/null
+++ b/tests/ui/issues/issue-40402-ref-hints/issue-40402-2.rs
@@ -0,0 +1,6 @@
+// Check that we do suggest `(ref a, ref b)` here, since `a` and `b`
+// are nested within a pattern
+fn main() {
+ let x = vec![(String::new(), String::new())];
+ let (a, b) = x[0]; //~ ERROR cannot move out of index
+}