mirror of https://github.com/rust-lang/book
Compare commits
2 Commits
99443e1416
...
6ab25d7ff1
Author | SHA1 | Date |
---|---|---|
octavio | 6ab25d7ff1 | |
octavio telles teichner | 521fb1cd68 |
|
@ -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