diff --git a/gc/default/default.c b/gc/default/default.c index af386a9793ae1d..7c10cc33063b0c 100644 --- a/gc/default/default.c +++ b/gc/default/default.c @@ -4377,7 +4377,7 @@ gc_grey(rb_objspace_t *objspace, VALUE obj) static inline void gc_mark_check_t_none(rb_objspace_t *objspace, VALUE obj) { - if (RB_UNLIKELY(RB_TYPE_P(obj, T_NONE))) { + if (RB_UNLIKELY(BUILTIN_TYPE(obj) == T_NONE)) { enum {info_size = 256}; char obj_info_buf[info_size]; rb_raw_obj_info(obj_info_buf, info_size, obj); diff --git a/test/ruby/test_namespace.rb b/test/ruby/test_namespace.rb index af308ab15c25e3..5661a98ca2b5f1 100644 --- a/test/ruby/test_namespace.rb +++ b/test/ruby/test_namespace.rb @@ -552,7 +552,7 @@ def test_prelude_gems_and_loaded_features # No additional warnings except for experimental warnings assert_includes error.join("\n"), EXPERIMENTAL_WARNINGS - assert_equal error.size, 2 + assert_equal 2, error.size assert_includes output.grep(/^before:/).join("\n"), '/bundled_gems.rb' assert_includes output.grep(/^before:/).join("\n"), '/error_highlight.rb' @@ -574,7 +574,7 @@ def test_prelude_gems_and_loaded_features_with_disable_gems end; assert_includes error.join("\n"), EXPERIMENTAL_WARNINGS - assert_equal error.size, 2 + assert_equal 2, error.size refute_includes output.grep(/^before:/).join("\n"), '/bundled_gems.rb' refute_includes output.grep(/^before:/).join("\n"), '/error_highlight.rb' diff --git a/zjit/bindgen/src/main.rs b/zjit/bindgen/src/main.rs index 77d482db4e9d97..43fec090149ef8 100644 --- a/zjit/bindgen/src/main.rs +++ b/zjit/bindgen/src/main.rs @@ -130,7 +130,7 @@ fn main() { .allowlist_function("rb_singleton_class") .allowlist_function("rb_define_class") .allowlist_function("rb_class_get_superclass") - .allowlist_function("rb_gc_disable_no_rest") + .allowlist_function("rb_gc_disable") .allowlist_function("rb_gc_enable") .allowlist_function("rb_gc_mark") .allowlist_function("rb_gc_mark_movable") diff --git a/zjit/src/backend/arm64/mod.rs b/zjit/src/backend/arm64/mod.rs index 6750926b35daa1..74b5210f0fb0a6 100644 --- a/zjit/src/backend/arm64/mod.rs +++ b/zjit/src/backend/arm64/mod.rs @@ -692,10 +692,10 @@ impl Assembler { /// need to be split with registers after `alloc_regs`, e.g. for `compile_side_exits`, so this /// splits them and uses scratch registers for it. fn arm64_split_with_scratch_reg(mut self) -> Assembler { - let mut iterator = self.insns.into_iter().enumerate().peekable(); + let iterator = self.insns.into_iter().enumerate().peekable(); let mut asm = Assembler::new_with_label_names(take(&mut self.label_names), self.live_ranges.len(), true); - while let Some((_, mut insn)) = iterator.next() { + for (_, mut insn) in iterator { match &mut insn { // For compile_side_exits, support splitting simple C arguments here Insn::CCall { opnds, .. } if !opnds.is_empty() => { diff --git a/zjit/src/cruby.rs b/zjit/src/cruby.rs index 4eb1d3a17c836e..dca4d9180556e8 100644 --- a/zjit/src/cruby.rs +++ b/zjit/src/cruby.rs @@ -897,7 +897,7 @@ where // 2. If we yield to the GC while compiling, it re-enters our mark and update functions. // This breaks `&mut` exclusivity since mark functions derive fresh `&mut` from statics // while there is a stack frame below it that has an overlapping `&mut`. That's UB. - let gc_disabled_pre_call = unsafe { rb_gc_disable_no_rest() }.test(); + let gc_disabled_pre_call = unsafe { rb_gc_disable() }.test(); let ret = match catch_unwind(func) { Ok(result) => result, diff --git a/zjit/src/cruby_bindings.inc.rs b/zjit/src/cruby_bindings.inc.rs index 6a6263ab15110a..17cda12a0b6204 100644 --- a/zjit/src/cruby_bindings.inc.rs +++ b/zjit/src/cruby_bindings.inc.rs @@ -746,6 +746,7 @@ unsafe extern "C" { pub fn rb_gc_mark_movable(obj: VALUE); pub fn rb_gc_location(obj: VALUE) -> VALUE; pub fn rb_gc_enable() -> VALUE; + pub fn rb_gc_disable() -> VALUE; pub fn rb_gc_writebarrier(old: VALUE, young: VALUE); pub fn rb_class_get_superclass(klass: VALUE) -> VALUE; pub static mut rb_cObject: VALUE; @@ -877,7 +878,6 @@ unsafe extern "C" { buff_size: usize, obj: VALUE, ) -> *const ::std::os::raw::c_char; - pub fn rb_gc_disable_no_rest() -> VALUE; pub fn rb_ec_stack_check(ec: *mut rb_execution_context_struct) -> ::std::os::raw::c_int; pub fn rb_gc_writebarrier_remember(obj: VALUE); pub fn rb_shape_id_offset() -> i32;