-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correct suggestion for significant_drop_in_scrutinee in expressi…
…ons (#14019) This PR fixes an issue with the `significant_drop_in_scrutinee`, where the lint generates invalid Rust syntax when suggesting fixes for match expressions that are part of larger expressions, such as in assignment contexts. For example: ```rust let mutex = Mutex::new(State {}); let _ = match mutex.lock().unwrap().foo() { true => 0, false => 1, }; ``` would suggest: ```rust let _ = let value = mutex.lock().unwrap().foo(); match value { ``` With this PR, it now suggests: ```rust let value = mutex.lock().unwrap().foo(); let _ = match value { ``` closes: #13986 changelog: [`significant_drop_in_scrutinee`] Fix incorrect suggestion for `significant_drop_in_scrutinee` lint in expression context
- Loading branch information
Showing
3 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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