Closed
Description
Given the following code:
fn foo() -> _ { 5 } //~ ERROR E0121
static BAR: _ = "test"; //~ ERROR E0121
fn main() {}
The current output is:
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
--> src/main.rs:1:13
|
1 | fn foo() -> _ { 5 } //~ ERROR E0121
| ^
| |
| not allowed in type signatures
| help: replace with the correct return type: `i32`
error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
--> src/main.rs:3:13
|
3 | static BAR: _ = "test"; //~ ERROR E0121
| ^
| |
| not allowed in type signatures
| help: replace with the correct type: `&str`
For more information about this error, try `rustc --explain E0121`.
Both suggestions are valid here, but when I run cargo fix --broken-code
, only the function will be fixed, and the static
item will be left untouched for some reason 🤔
Looks like an oversight to me.