mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
18 lines
223 B
Rust
18 lines
223 B
Rust
//@ 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 });
|
|
}
|