Skip to content

Commit 1ed232e

Browse files
pbolingmatsadler
authored andcommitted
docs: reserved slots
1 parent e3ab21b commit 1ed232e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/typed_data.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ where
352352
#[cfg(ruby_lt_4_1)]
353353
reserved: [ptr::null_mut(); 1],
354354
#[cfg(ruby_gte_4_1)]
355-
reserved: [ptr::null_mut(); 1],
355+
// Ruby 4.1 expands rtypeddata's reserved slots; keep in sync with
356+
// https://github.com/ruby/ruby/blob/master/include/ruby/internal/core/rtypeddata.h
357+
reserved: [ptr::null_mut(); 7],
356358
#[cfg(ruby_gte_4_1)]
357359
handle_weak_references: None,
358360
},

tests/typed_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ fn it_wraps_rust_struct() {
2222
rb_assert!(ruby, "val.class == Example", val);
2323

2424
let ex: &Example = eval!(ruby, "val", val).unwrap();
25-
assert_eq!("foo", ex.value)
25+
assert_eq!("foo", ex.value);
2626
}

0 commit comments

Comments
 (0)