Pattern Migration 2024: suggest nicer patterns by dianne · Pull Request #136496 · rust-lang/rust
rustbot
added
S-waiting-on-review
labels
Feb 3, 2025matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
Feb 7, 2025…fication, r=Nadrieril Pattern Migration 2024: try to suggest eliding redundant binding modifiers This is based on rust-lang#136475. Only the last commit is new. This is a simpler, more restrictive alternative to rust-lang#136496, meant to partially address rust-lang#136047. If a pattern can be migrated to Rust 2024 solely by removing redundant binding modifiers, this will make that suggestion; otherwise, it uses the old suggestion of making the pattern fully explicit. Relevant tracking issue: rust-lang#131414 `@rustbot` label A-diagnostics A-patterns A-edition-2024 r? `@Nadrieril`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
Feb 7, 2025…fication, r=Nadrieril Pattern Migration 2024: try to suggest eliding redundant binding modifiers This is based on rust-lang#136475. Only the last commit is new. This is a simpler, more restrictive alternative to rust-lang#136496, meant to partially address rust-lang#136047. If a pattern can be migrated to Rust 2024 solely by removing redundant binding modifiers, this will make that suggestion; otherwise, it uses the old suggestion of making the pattern fully explicit. Relevant tracking issue: rust-lang#131414 ``@rustbot`` label A-diagnostics A-patterns A-edition-2024 r? ``@Nadrieril``
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Feb 7, 2025Rollup merge of rust-lang#136577 - dianne:simple-pat-migration-simplification, r=Nadrieril Pattern Migration 2024: try to suggest eliding redundant binding modifiers This is based on rust-lang#136475. Only the last commit is new. This is a simpler, more restrictive alternative to rust-lang#136496, meant to partially address rust-lang#136047. If a pattern can be migrated to Rust 2024 solely by removing redundant binding modifiers, this will make that suggestion; otherwise, it uses the old suggestion of making the pattern fully explicit. Relevant tracking issue: rust-lang#131414 ``@rustbot`` label A-diagnostics A-patterns A-edition-2024 r? ``@Nadrieril``
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request
Feb 16, 2025…tion, r=Nadrieril Pattern Migration 2024: clean up and comment This follows up on rust-lang#136577 by moving the pattern migration logic to its own module, removing a bit of unnecessary complexity, and adding comments. Since there's quite a bit of pattern migration logic now (and potentially more in rust-lang#136496), I think it makes sense to keep it separate from THIR construction, at least as much as is convenient. r? `@Nadrieril`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
Feb 17, 2025…tion, r=Nadrieril Pattern Migration 2024: clean up and comment This follows up on rust-lang#136577 by moving the pattern migration logic to its own module, removing a bit of unnecessary complexity, and adding comments. Since there's quite a bit of pattern migration logic now (and potentially more in rust-lang#136496), I think it makes sense to keep it separate from THIR construction, at least as much as is convenient. r? ``@Nadrieril``
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Feb 17, 2025Rollup merge of rust-lang#136817 - dianne:clean-and-comment-pat-migration, r=Nadrieril Pattern Migration 2024: clean up and comment This follows up on rust-lang#136577 by moving the pattern migration logic to its own module, removing a bit of unnecessary complexity, and adding comments. Since there's quite a bit of pattern migration logic now (and potentially more in rust-lang#136496), I think it makes sense to keep it separate from THIR construction, at least as much as is convenient. r? ``@Nadrieril``
A slight refactor: we'll always want to pass the mutability in to `push_deref` to determine the default binding mode when a pattern is removed, so this eliminates the redundancy of having both that and the user's dbm as separate arguments.
This doesn't yet respect whether patterns are from macro expansions, so it may try to suggest changes within an expansion (leading to a test failure).
dianne
deleted the
beautify-pat-migration-output
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters