summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/unused-mut-issue-50343.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/nll/unused-mut-issue-50343.rs')
-rw-r--r--tests/ui/nll/unused-mut-issue-50343.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/nll/unused-mut-issue-50343.rs b/tests/ui/nll/unused-mut-issue-50343.rs
new file mode 100644
index 000000000..c849ac8c7
--- /dev/null
+++ b/tests/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
+}