Skip to content

MIR borrowck: spurious error with ref pattern in argument #46161

Closed
@arielb1

Description

@arielb1

e.g. (or src/test/run-pass/issue-8860.rs)

fn main() {}
fn foo(ref x: Box<()>) {}

The problem is that region inference infers the borrow of x to ReEmpty (because it's live nowhere), which doesn't have an EndRegion. NLL mode (-Z nll) is not affected by this particular pathology, but I think this should still be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-borrow-checkerArea: The borrow checkerC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions