summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-50461-used-mut-from-moves.rs
blob: 2458b171e645851b864c976842950fce9a4f9b35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass

#![deny(unused_mut)]
#![allow(dead_code)]

struct Foo {
    pub value: i32
}

fn use_foo_mut(mut foo: Foo) {
    foo = foo;
    println!("{}", foo.value);
}

fn main() {
    use_foo_mut(Foo { value: 413 });
}