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
cargo clippy --fix does not try to fix things that cargo clippy does not complain about.
Instead, this happened:
PS C:\Users\Benni\repositories\scfia-lib> cargo clippy --fix
Checking scfia-lib v0.1.0 (C:\Users\Benni\repositories\scfia-lib)
warning: failed to automatically apply fixes suggested by rustc to crate `scfia_lib`
after fixes were automatically applied the compiler reported errors within these files:
* src\z3_handle.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[E0382]: borrow of moved value: `b1`
--> src\z3_handle.rs:485:64
|
481 | let b1 = z3.new_bool_concrete(true);
| -- move occurs because `b1` has type `z3_handle::Z3Ast<models::riscv::rv32i::RV32iScfiaComposition>`, which does not implement the `Copy` trait
...
484 | let b2 = b1;
| -- value moved here
485 | assert!(Rc::ptr_eq(&b2.z3.upgrade().unwrap(), &b1.z3.upgrade().unwrap()));
| ^^^^^^^^^^^^^^^ value borrowed here after move
|
help: consider cloning the value if the performance cost is acceptable
|
484 | let b2 = b1.clone();
| ++++++++
error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`.
Original diagnostics will follow.
warning: redundant clone
--> src\z3_handle.rs:484:28
|
484 | let b2 = b1.clone();
| ^^^^^^^^ help: remove this
|
note: cloned value is neither consumed nor mutated
--> src\z3_handle.rs:484:26
|
484 | let b2 = b1.clone();
| ^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
= note: `#[warn(clippy::redundant_clone)]` on by default
warning: `scfia-lib` (lib test) generated 1 warning (run `cargo clippy --fix --lib -p scfia-lib --tests` to apply 1 suggestion)
Finished dev [unoptimized + debuginfo] target(s) in 3.18s
I think cargo clippy just runs the default target whereas cargo clippy --fix runs wtih --all-targets by default, so it is also going to check tests for example.
I tried to use cargo clippy on this code: https://github.com/scfia/scfia-lib/tree/5e75b6da14cc00b925f2c83a4179b89ad85d8592
I expected to see this happen:
cargo clippy --fix
does not fail.cargo clippy --fix
does not try to fix things thatcargo clippy
does not complain about.Instead, this happened:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: