You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…ishearth
Compare empty blocks for equality based on tokens
fixes: rust-lang#1390
This only considers empty blocks for now, though we should also catch something like this:
```rust
match 0 {
0 => {
do_something();
trace!(0);
0
}
1 => {
do_something();
trace!(1);
1
}
x => x,
}
```
As far as I can tell there aren't any negative effects on other lints. These blocks only happen to be the same for a given compilation, not all compilations.
changelog: Fix `match_on_same_arms` and others. Only consider empty blocks equal if the tokens contained are the same.
Kobzol
pushed a commit
to Kobzol/rust
that referenced
this issue
Dec 30, 2024
This shouldn't compile without annotating the parameter as
copy
kind, but it does:If you return by
ret
, the problem is detected.The text was updated successfully, but these errors were encountered: