Skip to content

regression 1.50: Borrow checker reports function param as not living long enough #80949

Description

@rylev

This might not actually be a regression an instead the code may have previously erroneously compiled. I cannot find an an open issue obviously related to this though.

As you can see here this code does not compile with a "borrowed value does not live long enough" where it did previously. This comes from a call to diff::diff which has this signature.

The error message states that n may be dropped while the borrow in the next param state is still active. This fails to compile on both 1.50 and 1.49 if the param state is move to a local variable.

@rustbot modify labels: +regression-from-stable-to-beta

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

Labels

A-borrow-checkerArea: The borrow checkerP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions