Warning
This post was published 56 days ago. The information described in this article may have changed.
fn main() {
let i1 = &1;
let i2 = &1;
if i1 == i2 {
println!("immutable borrow is the same reference");
}
}
so, there is only one i32 and i1 and i2 is the same reference, they both reference to the same 1?
is there any rust document explain this?
6 posts - 6 participants
🏷️ rust_feed