summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/unused-mut-issue-50343.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/nll/unused-mut-issue-50343.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/nll/unused-mut-issue-50343.rs b/src/test/ui/nll/unused-mut-issue-50343.rs
new file mode 100644
index 000000000..c849ac8c7
--- /dev/null
+++ b/src/test/ui/nll/unused-mut-issue-50343.rs
@@ -0,0 +1,9 @@
+// run-rustfix
+
+#![deny(unused_mut)]
+#![allow(unused_variables)] // for rustfix
+
+fn main() {
+ vec![(42, 22)].iter().map(|(mut x, _y)| ()).count();
+ //~^ ERROR: variable does not need to be mutable
+}