@@ -407,7 +407,7 @@ pub struct InsnPrinter<'a> {
407407impl < ' a > std:: fmt:: Display for InsnPrinter < ' a > {
408408 fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
409409 match & self . inner {
410- Insn :: Const { val } => { write ! ( f, "Const {}" , val. print( & self . ptr_map) ) }
410+ Insn :: Const { val } => { write ! ( f, "Const {}" , val. print( self . ptr_map) ) }
411411 Insn :: Param { idx } => { write ! ( f, "Param {idx}" ) }
412412 Insn :: NewArray { elements } => {
413413 write ! ( f, "NewArray" ) ?;
@@ -462,8 +462,8 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
462462 Insn :: FixnumGt { left, right, .. } => { write ! ( f, "FixnumGt {left}, {right}" ) } ,
463463 Insn :: FixnumGe { left, right, .. } => { write ! ( f, "FixnumGe {left}, {right}" ) } ,
464464 Insn :: GuardType { val, guard_type, .. } => { write ! ( f, "GuardType {val}, {guard_type}" ) } ,
465- Insn :: GuardBitEquals { val, expected, .. } => { write ! ( f, "GuardBitEquals {val}, {}" , expected. print( & self . ptr_map) ) } ,
466- Insn :: PatchPoint ( invariant) => { write ! ( f, "PatchPoint {}" , invariant. print( & self . ptr_map) ) } ,
465+ Insn :: GuardBitEquals { val, expected, .. } => { write ! ( f, "GuardBitEquals {val}, {}" , expected. print( self . ptr_map) ) } ,
466+ Insn :: PatchPoint ( invariant) => { write ! ( f, "PatchPoint {}" , invariant. print( self . ptr_map) ) } ,
467467 Insn :: GetConstantPath { ic } => { write ! ( f, "GetConstantPath {:p}" , self . ptr_map. map_ptr( ic) ) } ,
468468 insn => { write ! ( f, "{insn:?}" ) }
469469 }
@@ -802,7 +802,7 @@ impl Function {
802802 Insn :: Const { val : Const :: CInt8 ( val) } => Type :: from_cint ( types:: CInt8 , * val as i64 ) ,
803803 Insn :: Const { val : Const :: CInt16 ( val) } => Type :: from_cint ( types:: CInt16 , * val as i64 ) ,
804804 Insn :: Const { val : Const :: CInt32 ( val) } => Type :: from_cint ( types:: CInt32 , * val as i64 ) ,
805- Insn :: Const { val : Const :: CInt64 ( val) } => Type :: from_cint ( types:: CInt64 , * val as i64 ) ,
805+ Insn :: Const { val : Const :: CInt64 ( val) } => Type :: from_cint ( types:: CInt64 , * val) ,
806806 Insn :: Const { val : Const :: CUInt8 ( val) } => Type :: from_cint ( types:: CUInt8 , * val as i64 ) ,
807807 Insn :: Const { val : Const :: CUInt16 ( val) } => Type :: from_cint ( types:: CUInt16 , * val as i64 ) ,
808808 Insn :: Const { val : Const :: CUInt32 ( val) } => Type :: from_cint ( types:: CUInt32 , * val as i64 ) ,
@@ -1260,7 +1260,7 @@ fn ep_offset_to_local_idx(iseq: IseqPtr, ep_offset: u32) -> usize {
12601260
12611261impl FrameState {
12621262 fn new ( iseq : IseqPtr ) -> FrameState {
1263- FrameState { iseq, pc : 0 as * const VALUE , insn_idx : 0 , stack : vec ! [ ] , locals : vec ! [ ] }
1263+ FrameState { iseq, pc : std :: ptr :: null :: < VALUE > ( ) , insn_idx : 0 , stack : vec ! [ ] , locals : vec ! [ ] }
12641264 }
12651265
12661266 /// Get the number of stack operands
@@ -1343,7 +1343,7 @@ fn compute_jump_targets(iseq: *const rb_iseq_t) -> Vec<u32> {
13431343 let mut jump_targets = HashSet :: new ( ) ;
13441344 while insn_idx < iseq_size {
13451345 // Get the current pc and opcode
1346- let pc = unsafe { rb_iseq_pc_at_idx ( iseq, insn_idx. into ( ) ) } ;
1346+ let pc = unsafe { rb_iseq_pc_at_idx ( iseq, insn_idx) } ;
13471347
13481348 // try_into() call below is unfortunate. Maybe pick i32 instead of usize for opcodes.
13491349 let opcode: u32 = unsafe { rb_iseq_opcode_at_pc ( iseq, pc) }
@@ -1409,7 +1409,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
14091409 entry_state. locals . push ( fun. push_insn ( fun. entry_block , Insn :: Const { val : Const :: Value ( Qnil ) } ) ) ;
14101410 }
14111411 }
1412- queue. push_back ( ( entry_state, fun. entry_block , /*insn_idx=*/ 0 as u32 ) ) ;
1412+ queue. push_back ( ( entry_state, fun. entry_block , /*insn_idx=*/ 0_u32 ) ) ;
14131413
14141414 let mut visited = HashSet :: new ( ) ;
14151415
@@ -1438,7 +1438,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
14381438 while insn_idx < iseq_size {
14391439 state. insn_idx = insn_idx as usize ;
14401440 // Get the current pc and opcode
1441- let pc = unsafe { rb_iseq_pc_at_idx ( iseq, insn_idx. into ( ) ) } ;
1441+ let pc = unsafe { rb_iseq_pc_at_idx ( iseq, insn_idx) } ;
14421442 state. pc = pc;
14431443 let exit_state = state. clone ( ) ;
14441444
0 commit comments