-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
Summary
Ran cargo clippy --fix --allow-dirty --all and noticed this output alongside the normal warnings:
after fixes were automatically applied the compiler reported errors within these files:
* language\codegen\src\debug.rs
* language\codegen\src\irgen.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[E0308]: mismatched types
--> language\codegen\src\debug.rs:91:21
|
87 | .create_array_type(
| ----------------- arguments to this method are incorrect
...
91 | &(0..len as i64).collect::<std::vec::Vec<i64>>(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[Range<i64>]`, found `&Vec<i64>`
|
= note: expected reference `&[std::ops::Range<i64>]`
found reference `&std::vec::Vec<i64>`
note: method defined here
--> C:\Users\marci\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\inkwell-0.7.1\src\debug_info.rs:784:12
|
784 | pub fn create_array_type(
| ^^^^^^^^^^^^^^^^^
error[E0382]: borrow of partially moved value: `ty_disc`
--> language\codegen\src\irgen.rs:1314:37
|
1296 | Type::Array(_type_discriminant) => {
| ------------------ value partially moved here
...
1314 | ty_disc.clone(),
| ^^^^^^^ value borrowed here after partial move
|
= note: partial move occurs because value has type `(std::boxed::Box<common::tokenizer::Token>, usize)`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
1296 | Type::Array(ref _type_discriminant) => {
| +++
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0308, E0382.
For more information about an error, try `rustc --explain E0308`.
Original diagnostics will follow.
Reproducer
Code:
debug_info_builder
.create_array_type(
inner_type.as_type(),
(inner_ty_disc.sizeof(custom_types.clone()) * len) as u64,
inner_type.as_type().get_align_in_bits(),
&[0..len as i64],
)
.as_type()create_array_type signature
The other code's original state was:
match foo {
Type::Array(ref type_discriminant) => {
// . . .
}
}Not sure why it was recommending me to add ref when it was already there.
Version
rustc 1.94.0-nightly (f52090008 2025-12-10)
binary: rustc
commit-hash: f5209000832c9d3bc29c91f4daef4ca9f28dc797
commit-date: 2025-12-10
host: x86_64-pc-windows-msvc
release: 1.94.0-nightly
LLVM version: 21.1.5
Additional Labels
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing