aboutsummaryrefslogtreecommitdiffstats
path: root/yjit
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-11-10 15:26:02 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2023-11-10 16:55:56 -0500
commit408d5886cf653c1fbf51880095766fd54da737d2 (patch)
tree7282ae3dbc560b82a660a97ecd337c0fbf4d3c6b /yjit
parent0a93ea4808d0d5c2cd0a757abe664e572036fe80 (diff)
downloadruby-408d5886cf653c1fbf51880095766fd54da737d2.tar.gz
YJIT: Auto fix for clippy::unnecessary_cast
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/codegen.rs2
-rw-r--r--yjit/src/core.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index e99161c9f0..3919be788a 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -2459,7 +2459,7 @@ fn gen_setinstancevariable(
// If the VM ran out of shapes, or this class generated too many leaf,
// it may be de-optimized into OBJ_TOO_COMPLEX_SHAPE (hash-table).
if next_shape_id == OBJ_TOO_COMPLEX_SHAPE_ID {
- Some((next_shape_id, None, 0 as usize))
+ Some((next_shape_id, None, 0_usize))
} else {
let current_capacity = unsafe { (*current_shape).capacity };
diff --git a/yjit/src/core.rs b/yjit/src/core.rs
index 68d705a4bf..1a3031af57 100644
--- a/yjit/src/core.rs
+++ b/yjit/src/core.rs
@@ -1847,7 +1847,7 @@ impl Context {
// Update the type bits
let type_bits = local_type as u32;
assert!(type_bits <= 0b1111);
- let mask_bits = (0b1111 as u32) << (4 * local_idx);
+ let mask_bits = 0b1111_u32 << (4 * local_idx);
let shifted_bits = type_bits << (4 * local_idx);
self.local_types = (self.local_types & !mask_bits) | shifted_bits;
}
@@ -2044,7 +2044,7 @@ impl Assembler {
pub fn shift_stack(&mut self, argc: usize) {
assert!(argc < self.ctx.stack_size.into());
- let method_name_index = (self.ctx.stack_size as usize) - (argc as usize) - 1;
+ let method_name_index = (self.ctx.stack_size as usize) - argc - 1;
for i in method_name_index..(self.ctx.stack_size - 1) as usize {
if i + 1 < MAX_TEMP_TYPES {