Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b088c8

Browse files
authored
ZJIT: Clean up RangeType (#14627)
1 parent 93c728c commit 6b088c8

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

zjit/src/codegen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ fn gen_new_range(
12901290
gen_prepare_non_leaf_call(jit, asm, state);
12911291

12921292
// Call rb_range_new(low, high, flag)
1293-
asm_ccall!(asm, rb_range_new, low, high, (flag as i64).into())
1293+
asm_ccall!(asm, rb_range_new, low, high, (flag as i32).into())
12941294
}
12951295

12961296
fn gen_new_range_fixnum(

zjit/src/hir.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ impl Const {
286286
}
287287
}
288288

289+
#[derive(Clone, Copy)]
289290
pub enum RangeType {
290291
Inclusive = 0, // include the end value
291292
Exclusive = 1, // exclude the end value
@@ -306,14 +307,6 @@ impl std::fmt::Debug for RangeType {
306307
}
307308
}
308309

309-
impl Clone for RangeType {
310-
fn clone(&self) -> Self {
311-
*self
312-
}
313-
}
314-
315-
impl Copy for RangeType {}
316-
317310
impl From<u32> for RangeType {
318311
fn from(flag: u32) -> Self {
319312
match flag {
@@ -324,12 +317,6 @@ impl From<u32> for RangeType {
324317
}
325318
}
326319

327-
impl From<RangeType> for u32 {
328-
fn from(range_type: RangeType) -> Self {
329-
range_type as u32
330-
}
331-
}
332-
333320
/// Special regex backref symbol types
334321
#[derive(Debug, Clone, Copy, PartialEq)]
335322
pub enum SpecialBackrefSymbol {

0 commit comments

Comments
 (0)