Closed
Description
In the ownership guide is an example for borrowing that doesn't work with the previously introduced main function. I guess this is because cross-borrowing is not allowed anymore?
fn main() {
let x = box 5i;
add_one(x);
println!("{}", x);
}
fn add_one(num: &mut int) {
*num += 1;
}
See: https://github.com/rust-lang/rust/blob/master/src/doc/guide-ownership.md#borrowing
Metadata
Metadata
Assignees
Labels
No labels