We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5ed6aa commit 7868b8fCopy full SHA for 7868b8f
src/scope/borrow.md
@@ -30,14 +30,13 @@ fn main() {
30
borrow_i32(&stacked_i32);
31
32
{
33
- // Take a reference to the data contained inside the box
34
- let _ref_to_i32: &i32 = &boxed_i32;
35
-
36
// Error!
37
- // Can't destroy `boxed_i32` while the inner value is borrowed.
+ // Can't destroy `boxed_i32` while the inner value is borrowed later in scope.
38
eat_box_i32(boxed_i32);
39
// FIXME ^ Comment out this line
40
+ // Take a reference to the data contained inside the box
+ let _ref_to_i32: &i32 = &boxed_i32;
41
// `_ref_to_i32` goes out of scope and is no longer borrowed.
42
}
43
0 commit comments