From 45a76e867a1d9dab7e644d06ea9148183fd4f1a3 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Sat, 7 May 2022 03:22:36 +0200 Subject: [PATCH] Rephrase improperly reduced borrows introduction (#352) Co-authored-by: Yuki Okushi --- src/lifetime-mismatch.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lifetime-mismatch.md b/src/lifetime-mismatch.md index 18082a4..0494d49 100644 --- a/src/lifetime-mismatch.md +++ b/src/lifetime-mismatch.md @@ -73,9 +73,10 @@ care about, but the lifetime system is too coarse-grained to handle that. ## Improperly reduced borrows -The following code fails to compile, because Rust doesn't understand that the borrow -is no longer needed and conservatively falls back to using a whole scope for it. -This will eventually get fixed. +The following code fails to compile, because Rust sees that a variable, `map`, +is borrowed twice, and can not infer that the first borrow stops to be needed +before the second one occurs. This is caused by Rust conservatively falling back +to using a whole scope for the first borow. This will eventually get fixed. ```rust,compile_fail # use std::collections::HashMap;