about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorTimo <30553356+y21@users.noreply.github.com>2025-01-21 02:28:23 +0000
committerGitHub <noreply@github.com>2025-01-21 02:28:23 +0000
commitd1b5fa2416f48abc4e5f54df040a3aed864c88cf (patch)
tree2248fd291ae54532fe894c5ce70a15f7aad48f6a /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent8f1b4bb87a9c028391f779c83dd4cecb615bd67b (diff)
parent23e602cd94efecf2136a29e77d335aedf9ffea74 (diff)
downloadrust-d1b5fa2416f48abc4e5f54df040a3aed864c88cf.tar.gz
rust-d1b5fa2416f48abc4e5f54df040a3aed864c88cf.zip
fix: correct suggestion for significant_drop_in_scrutinee in expressions (#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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions