mirror of https://github.com/rust-lang/book
Merge 521fb1cd68
into cb0a24007f
This commit is contained in:
commit
99443e1416
|
@ -6,9 +6,9 @@ fn main() {
|
|||
|
||||
let x = 5; // x comes into scope
|
||||
|
||||
makes_copy(x); // x would move into the function,
|
||||
// but i32 is Copy, so it's okay to still
|
||||
// use x afterward
|
||||
makes_copy(x); // since i32 implements the Copy trait,
|
||||
// x does NOT move into the function,
|
||||
println!("{}", x); // so it's okay to use x afterward
|
||||
|
||||
} // Here, x goes out of scope, then s. But because s's value was moved, nothing
|
||||
// special happens.
|
||||
|
|
Loading…
Reference in New Issue