Skip to content

NLL: unexpected "free region `` does not outlive" error #49824

Closed

Description

In the test borrowck/borrowck-describe-lvalue.rs, when using NLL by default for MIR borrowck, I started getting the odd error "Free region does not outlive" error below:

    // Field from upvar nested
    {
        let mut x = 0;
           || {
               || { //[mir]~ ERROR free region `` does not outlive
                   let y = &mut x;
                   &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
                   //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
                   *y = 1;
                   drop(y);
                }
           };
    }

Seems like a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.NLL-completeWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions