2018-09-06 07:41:12 -05:00
|
|
|
// run-pass
|
|
|
|
|
2018-05-12 16:32:11 -05:00
|
|
|
#![deny(unused_mut)]
|
2021-07-14 08:34:28 -05:00
|
|
|
#![allow(dead_code)]
|
2018-05-12 16:32:11 -05:00
|
|
|
|
|
|
|
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 });
|
|
|
|
}
|