Skip to content

if-let-rescope migration with cargo fix --edition differs from documentation #133742

Closed as not planned
@mitsuhiko

Description

@mitsuhiko

This is tangentially related to #133167. I was looking for a way to opt out of that fix given the large number of false positives. A discussion in zulip pointed out that this lint as per documentation should not be enabled by default.

The if_let_rescope lint cannot deduce with complete confidence that the program semantics are preserved when the lifetime of such temporary values are shortened. For this reason, the suggestion from this lint is not automatically applied when running cargo fix --edition.

It is however definitely automatically applied. I'm not sure if this is a bug in the documentation or a bug in the implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-edition-2024Area: The 2024 editionC-bugCategory: This is a bug.T-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