diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-11958.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-11958.rs b/src/test/ui/issues/issue-11958.rs new file mode 100644 index 000000000..a7af01e25 --- /dev/null +++ b/src/test/ui/issues/issue-11958.rs @@ -0,0 +1,11 @@ +// run-pass + +// We shouldn't need to rebind a moved upvar as mut if it's already +// marked as mut + +pub fn main() { + let mut x = 1; + let _thunk = Box::new(move|| { x = 2; }); + //~^ WARN value assigned to `x` is never read + //~| WARN unused variable: `x` +} |