1
Fork 0

Update E0716.md

Clearer wording
This commit is contained in:
carschandler 2024-03-01 17:31:02 -06:00 committed by GitHub
parent 71a697327b
commit 50ff36239a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,9 +30,8 @@ let q = p;
Whenever a temporary is created, it is automatically dropped (freed) according Whenever a temporary is created, it is automatically dropped (freed) according
to fixed rules. Ordinarily, the temporary is dropped at the end of the enclosing to fixed rules. Ordinarily, the temporary is dropped at the end of the enclosing
statement -- in this case, after the outer `let` that assigns to `p`. This is statement -- in this case, after the `let p`. This is illustrated in the example
illustrated in the example above by showing that `tmp` would be freed as we exit above by showing that `tmp` would be freed as we exit the block.
the block.
To fix this problem, you need to create a local variable to store the value in To fix this problem, you need to create a local variable to store the value in
rather than relying on a temporary. For example, you might change the original rather than relying on a temporary. For example, you might change the original