-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.NLL-diagnosticsWorking towards the "diagnostic parity" goalWorking towards the "diagnostic parity" goalP-mediumMedium priorityMedium priority
Description
This diagnostic output
rust/src/test/ui/E0501.ast.nll.stderr
Lines 1 to 13 in f99911a
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access | |
--> $DIR/E0501.rs:28:23 | |
| | |
LL | let bar = || { | |
| -- closure construction occurs here | |
LL | inside_closure(a) | |
| - first borrow occurs due to use of `a` in closure | |
LL | }; | |
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access | |
| ^ borrow occurs here | |
... | |
LL | drop(bar); | |
| --- first borrow later used here |
is not a regression, per se. But we put in effort to identify something as the "first borrow" (rather than "previous borrow"); that means we should similarly identify the other borrow as the "second borrow".
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.NLL-diagnosticsWorking towards the "diagnostic parity" goalWorking towards the "diagnostic parity" goalP-mediumMedium priorityMedium priority