Open jyn514 opened 3 years ago
And related: unnecessary_cast
expands c_uint
to u32
, which will break on platforms where it's u16 or u64.
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index f122fa14e70..568959631d9 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -1420,7 +1420,7 @@ pub(crate) fn phi(
fn add_incoming_to_phi(&mut self, phi: &'ll Value, val: &'ll Value, bb: &'ll BasicBlock) {
unsafe {
- llvm::LLVMAddIncoming(phi, &val, &bb, 1 as c_uint);
+ llvm::LLVMAddIncoming(phi, &val, &bb, 1_u32);
}
}
(in practice, c_uint is always u32, but this could be relevant if this were c_ulong
or something.)
since https://github.com/rust-lang/rust-clippy/pull/8596 unnecessary_cast
does not lint type aliases at all anymore, so I guess this can be closed
@kraktus what about rc_buffer?
I tried this code (https://github.com/rust-lang/rust/blob/a6ff925f8b5598a1f6d84964525baa1d4a08fd63/compiler/rustc_infer/src/infer/region_constraints/mod.rs#L545):
I expected to see this happen: Clippy suggests
Lrc<[ty::Region<'tcx>]>
Instead, this happened: Clippy suggests
Rc<[ty::Region<'tcx>]>
Meta
cargo clippy -V
: clippy 0.0.212 (4760b8f 2020-10-25)