Skip to content

Extra semicolon after cargo clippy --fix #8336

@tvallotton

Description

@tvallotton

Summary

you can access a reproducible example in this branch: clippy-fix-error. It seems that clippy forgot to remove a semicolon but I'm not entirely sure. I ran clippy --fix from the models/models directory.

Version

rustc 1.58.1 (db9d1b20b 2022-01-20)
binary: rustc
commit-hash: db9d1b20bba1968c1ec1fc49616d4742c1725b4b
commit-date: 2022-01-20
host: aarch64-apple-darwin
release: 1.58.1
LLVM version: 13.0.0

Error output

Backtrace

warning: `models` (lib) generated 46 warnings
warning: failed to automatically apply fixes suggested by rustc to crate `models`

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

* models/src/orm/mod.rs
* models/src/private/scheduler/driver/migration.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[E0308]: mismatched types
 --> models/src/private/scheduler/driver/migration.rs:86:28
  |
86  |     pub fn commit(self) -> Result<Option<Report>> {
  |            ------          ^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()`
  |            |
  |            implicitly returns `()` as its body has no tail or `return` expression
...
104 |         };
  |          - help: consider removing this semicolon
  |
  = note:   expected enum `std::result::Result<std::option::Option<private::scheduler::driver::report::Report>, error::Error>`
          found unit type `()`

warning: unused import: `ConnectOptions`
--> models/src/orm/mod.rs:12:5
 |
12 |     ConnectOptions,
 |     ^^^^^^^^^^^^^^
 |
 = note: `#[warn(unused_imports)]` on by default

error: aborting due to previous error; 1 warning emitted

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

Metadata

Metadata

Assignees

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions