Skip to content

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

@mitsuhiko

Description

@mitsuhiko
Contributor

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.

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Dec 2, 2024
added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
C-bugCategory: This is a bug.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Dec 2, 2024
ehuss

ehuss commented on Dec 2, 2024

@ehuss
Contributor

Thanks for the report! This will be fixed by rust-lang/edition-guide#339. Closing since we don't track edition docs in this repo, and there is a PR up.

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

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

        Participants

        @mitsuhiko@ehuss@rustbot@Noratrieb

        Issue actions

          `if-let-rescope` migration with `cargo fix --edition` differs from documentation · Issue #133742 · rust-lang/rust