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