warning: failed to automatically apply fixes suggested by rustc to crate

Open
#16,426 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
tooling

Research direction

Reproduce with cargo clippy --fix --allow-dirty using rustc 1.92.0 on the reported project, then inspect src/event_handler.rs around lines 42 and 49 where the invalid generic argument is introduced. Compare the original and automatically modified code and determine whether the failure is in Clippy, Cargo, or rustc; done means the suggested fix applies without compiler errors.

Written by the indexing model from the issue text.

Description

C-bug I-suggestion-causes-error
Summary

Hello, this is my first time reporting an issue. Just following instructions that I got from clippy, if there's any additional information you want me to add that I'm missing I'd be happy to include it! I have the full logs attached below:

clippylog.txt

admin@Mac rynx_browser % cargo clippy --fix --allow-dirty
Checking rynx_browser v0.1.0 (/Users/admin/rustprojects/rynx_browser)
warning: failed to automatically apply fixes suggested by rustc to crate rynx_browser

after fixes were automatically applied the compiler reported errors within these files:

  • src/event_handler.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-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[E0107]: function takes 0 generic arguments but 1 generic argument was supplied
--> src/event_handler.rs:42:30
|
42 | InputMode::Normal => handle_normal_mode::(app, key, terminal_width, terminal_height),
| ^^^^^^^^^^^^^^^^^^----- help: remove the unnecessary generics
| |
| expected 0 generic arguments
|
note: function defined here, with 0 generic parameters
--> src/event_handler.rs:49:4
|
49 | fn handle_normal_mode(
| ^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

For more information about this error, try rustc --explain E0107.
Original diagnostics will follow.

Reproducer

Code:

<code>

Current output:

Desired output:

Version
rustc 1.92.0 (ded5c06cf 2025-12-08) (Homebrew)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: aarch64-apple-darwin
release: 1.92.0
LLVM version: 21.1.7
Additional Labels

@rustbot label +I-suggestion-causes-error

Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/rust-clippy

All issues in rust-lang/rust-clippy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.