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
scontain opened this issue
Dec 29, 2022
· 1 comment
· Fixed by #11576
Labels
C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when applied
fnmain(){println!("\nI doing {2} from {1} years and i {0} it",
"like", 20, "programming");}
I expected to see this happen: explanation
Instead, this happened: explanation
warning: failed to automatically apply fixes suggested by rustc to crate `ca_p1`
after fixes were automatically applied the compiler reported errors within these files:
* src/main.rs
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/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: invalid reference to positional argument 1 (there is 1 argument)
--> src/main.rs:5:38
|
5 | "\nI doing programming from {1} years and i like it", 20
| ^
|
= note: positional arguments are zero-based
error: argument never used
--> src/main.rs:5:63
|
5 | "\nI doing programming from {1} years and i like it", 20
| ---------------------------------------------------- ^^ argument never used
| |
| formatting specifier missing
error: aborting due to 2 previous errors
Original diagnostics will follow.
warning: literal with an empty format string
--> src/main.rs:6:21
|
6 | "like", 20, "programming"
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal
= note: `#[warn(clippy::print_literal)]` on by default
help: try this
|
5 ~ "\nI doing programming from {1} years and i {0} it",
6 ~ "like", 20
|
warning: literal with an empty format string
--> src/main.rs:6:9
|
6 | "like", 20, "programming"
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal
help: try this
|
5 - "\nI doing {2} from {1} years and i {0} it",
5 "\nI doing {2} from {1} years and i like it", 20, "programming"
|
warning: `ca_p1` (bin "ca_p1") generated 2 warnings
warning: `ca_p1` (bin "ca_p1" test) generated 2 warnings (2 duplicates)
C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when applied
I applied
cargo clippy --fix --allow-dirty
toI expected to see this happen: explanation
Instead, this happened: explanation
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: