Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mitsuhiko opened this issue Dec 2, 2024 · 1 comment
Closed
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-edition-2024 Area: The 2024 edition C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@mitsuhiko
Copy link
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.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 2, 2024
@Noratrieb Noratrieb added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. A-edition-2024 Area: The 2024 edition and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 2, 2024
@ehuss
Copy link
Contributor

ehuss commented Dec 2, 2024

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.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-edition-2024 Area: The 2024 edition C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants