Skip to content

Commit 45a76e8

Browse files
Rephrase improperly reduced borrows introduction (#352)
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
1 parent 44428ea commit 45a76e8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lifetime-mismatch.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ care about, but the lifetime system is too coarse-grained to handle that.
7373

7474
## Improperly reduced borrows
7575

76-
The following code fails to compile, because Rust doesn't understand that the borrow
77-
is no longer needed and conservatively falls back to using a whole scope for it.
78-
This will eventually get fixed.
76+
The following code fails to compile, because Rust sees that a variable, `map`,
77+
is borrowed twice, and can not infer that the first borrow stops to be needed
78+
before the second one occurs. This is caused by Rust conservatively falling back
79+
to using a whole scope for the first borow. This will eventually get fixed.
7980

8081
```rust,compile_fail
8182
# use std::collections::HashMap;

0 commit comments

Comments
 (0)