Skip to content

Conversation

brson
Copy link
Contributor

@brson brson commented May 7, 2014

Just small bits of polish.

@alexcrichton
Copy link
Member

r=me

bors added a commit that referenced this pull request May 9, 2014
@bors bors closed this May 9, 2014
@bors bors merged commit 2aa4253 into rust-lang:master May 9, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2023
Substitute VSCode variables more generally
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2025
…ons (rust-lang#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: rust-lang#13986

changelog: [`significant_drop_in_scrutinee`] Fix incorrect suggestion
for `significant_drop_in_scrutinee` lint in expression context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants