Skip to content

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

Closed
@rylev

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

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