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
warning: unneeded `return` statement
--> src/main.rs:9:5
|
9 | return unsafe {f1()} as *const i32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
9 - return unsafe {f1()} as *const i32;
9 + unsafe {f1()} as *const i32
|
but when doing autofixing I get:
after fixes were automatically applied the compiler reported errors within these files:
* xxx
This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/rust-clippy/issues
quoting the full output of this command we'd be very appreciative!
Note that you may be able to make some more progress in the near-term
fixing code with the `--broken-code` flag
The following errors were reported:
error: expected expression, found `as`
--> xxx
|
42 | unsafe {f1()} as *const i32
| ^^ expected expression
|
help: parentheses are required to parse this as an expression
|
42 | (unsafe {f1()}) as *const i32
| +
Summary
Running clippy on the below code suggests
but when doing autofixing I get:
Reproducer
I tried this code:
I expected to see this happen: clippy --fix work
Instead, this happened: Error
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: