Skip to content
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

fix rpass core-run-destroy for android #10336

Merged

Conversation

ksh8281
Copy link
Contributor

@ksh8281 ksh8281 commented Nov 7, 2013

fix rpass core-run-destroy for android

bors added a commit that referenced this pull request Nov 7, 2013
…droid, r=yichoi

fix rpass core-run-destroy for android
@bors bors closed this Nov 7, 2013
@bors bors merged commit f1cbb4d into rust-lang:master Nov 7, 2013
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Feb 26, 2023
manual_let_else: do not suggest semantically different replacements

The problem is that this lint does not consider the possibility that the divergent branch can come first and that the patterns may overlap. This led to incorrect suggestions, previously registered as correct in the tests themselves:

```rust
let v = match build_enum() {
    _ => continue,
    Variant::Bar(v) | Variant::Baz(v) => v,
};
```

had a `let Variant::Bar(v) | Variant::Baz(v) = v else { continue; }` suggestion, which is obviously wrong as the original code `continue`s in any case. Issue rust-lang#10241 gives another example.

The code now checks that the divergent branch comes second. It could be extended later (I've added a TODO) to check for non-overlapping patterns.

Fixes rust-lang#10241.

changelog: [`manual_let_else`] do not suggest non equivalent replacements in `match`
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.

3 participants