Skip to content

Commit 8b83697

Browse files
committed
Update rb-sys, rb-sys-build, and rb-sys-tests to version 0.9.124
1 parent 44cb572 commit 8b83697

File tree

10 files changed

+31
-25
lines changed

10 files changed

+31
-25
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rb-sys-build/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rb-sys-build"
3-
version = "0.9.123"
3+
version = "0.9.124"
44
edition = "2018"
55
description = "Build system for rb-sys"
66
homepage = "https://github.com/oxidize-rb/rb-sys"

crates/rb-sys-build/src/bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn clean_docs(rbconfig: &RbConfig, syntax: &mut syn::File) {
140140
})
141141
}
142142

143-
fn default_bindgen(clang_args: Vec<String>, rbconfig: &RbConfig) -> bindgen::Builder {
143+
fn default_bindgen(clang_args: Vec<String>, _rbconfig: &RbConfig) -> bindgen::Builder {
144144
// Disable layout tests and Debug impl on Windows MinGW due to packed struct layout incompatibilities
145145
let is_windows_mingw = cfg!(target_os = "windows") && !is_msvc();
146146

crates/rb-sys-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rb-sys-tests"
3-
version = "0.9.123"
3+
version = "0.9.124"
44
edition = "2018"
55
autotests = false
66
publish = false

crates/rb-sys/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
build = "build/main.rs"
33
name = "rb-sys"
4-
version = "0.9.123"
4+
version = "0.9.124"
55
edition = "2018"
66
readme = "readme.md"
77
categories = ["external-ffi-bindings"]
@@ -14,7 +14,7 @@ repository = "https://github.com/oxidize-rb/rb-sys"
1414
rust-version = "1.71"
1515

1616
[build-dependencies]
17-
rb-sys-build = { version = "0.9.123", path = "../rb-sys-build" }
17+
rb-sys-build = { version = "0.9.124", path = "../rb-sys-build" }
1818

1919
[dev-dependencies]
2020
rb-sys = { path = ".", features = ["link-ruby"] }

crates/rb-sys/src/macros.rs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use std::os::raw::{c_char, c_long};
3636
/// ```
3737
#[inline(always)]
3838
pub fn TEST(obj: VALUE) -> bool {
39-
api().rb_test(obj.into())
39+
api().rb_test(obj)
4040
}
4141

4242
/// Checks if the given object is nil.
@@ -55,7 +55,7 @@ pub fn TEST(obj: VALUE) -> bool {
5555
/// ```
5656
#[inline(always)]
5757
pub fn NIL_P(obj: VALUE) -> bool {
58-
api().nil_p(obj.into())
58+
api().nil_p(obj)
5959
}
6060

6161
/// Checks if the given object is a so-called Fixnum.
@@ -66,7 +66,7 @@ pub fn NIL_P(obj: VALUE) -> bool {
6666
/// - @note Fixnum was a thing in the 20th century, but it is rather an implementation detail today.
6767
#[inline(always)]
6868
pub fn FIXNUM_P(obj: VALUE) -> bool {
69-
api().fixnum_p(obj.into())
69+
api().fixnum_p(obj)
7070
}
7171

7272
/// Checks if the given object is a static symbol.
@@ -79,7 +79,7 @@ pub fn FIXNUM_P(obj: VALUE) -> bool {
7979
/// - @note These days there are static and dynamic symbols, just like we once had Fixnum/Bignum back in the old days.
8080
#[inline(always)]
8181
pub fn STATIC_SYM_P(obj: VALUE) -> bool {
82-
api().static_sym_p(obj.into())
82+
api().static_sym_p(obj)
8383
}
8484

8585
/// Get the backend storage of a Ruby array.
@@ -95,7 +95,7 @@ pub fn STATIC_SYM_P(obj: VALUE) -> bool {
9595
/// - @return Its backend storage.
9696
#[inline(always)]
9797
pub unsafe fn RARRAY_CONST_PTR(obj: VALUE) -> *const VALUE {
98-
api().rarray_const_ptr(obj.into())
98+
api().rarray_const_ptr(obj)
9999
}
100100

101101
/// Get the length of a Ruby array.
@@ -109,7 +109,7 @@ pub unsafe fn RARRAY_CONST_PTR(obj: VALUE) -> *const VALUE {
109109
/// - @return Its length.
110110
#[inline(always)]
111111
pub unsafe fn RARRAY_LEN(obj: VALUE) -> c_long {
112-
api().rarray_len(obj.into())
112+
api().rarray_len(obj)
113113
}
114114

115115
/// Get the length of a Ruby string.
@@ -123,21 +123,23 @@ pub unsafe fn RARRAY_LEN(obj: VALUE) -> c_long {
123123
/// - @return Its length.
124124
#[inline(always)]
125125
pub unsafe fn RSTRING_LEN(obj: VALUE) -> c_long {
126-
api().rstring_len(obj.into())
126+
api().rstring_len(obj)
127127
}
128128

129129
/// Get the backend storage of a Ruby string.
130130
///
131131
/// ### Safety
132132
///
133133
/// This function is unsafe because it dereferences a raw pointer and returns
134-
/// raw pointers to Ruby memory.
134+
/// raw pointers to Ruby memory. The caller must ensure that the pointer stays live
135+
/// for the duration of usage the the underlying array (by either GC marking or
136+
/// keeping the RArray on the stack).
135137
///
136138
/// - @param[in] a An object of ::RString.
137139
/// - @return Its backend storage
138140
#[inline(always)]
139141
pub unsafe fn RSTRING_PTR(obj: VALUE) -> *const c_char {
140-
api().rstring_ptr(obj.into())
142+
api().rstring_ptr(obj)
141143
}
142144

143145
/// Checks if the given object is a so-called Flonum.
@@ -150,7 +152,7 @@ pub unsafe fn RSTRING_PTR(obj: VALUE) -> *const c_char {
150152
/// once had Fixnum/Bignum back in the old days.
151153
#[inline(always)]
152154
pub fn FLONUM_P(obj: VALUE) -> bool {
153-
api().flonum_p(obj.into())
155+
api().flonum_p(obj)
154156
}
155157

156158
/// Checks if the given object is an immediate i.e. an object which has no
@@ -163,7 +165,7 @@ pub fn FLONUM_P(obj: VALUE) -> bool {
163165
/// @note The concept of "immediate" is purely C specific.
164166
#[inline(always)]
165167
pub fn IMMEDIATE_P(obj: VALUE) -> bool {
166-
api().immediate_p(obj.into())
168+
api().immediate_p(obj)
167169
}
168170

169171
/// Checks if the given object is of enum ::ruby_special_consts.
@@ -183,7 +185,7 @@ pub fn IMMEDIATE_P(obj: VALUE) -> bool {
183185
/// ```
184186
#[inline(always)]
185187
pub fn SPECIAL_CONST_P(obj: VALUE) -> bool {
186-
api().special_const_p(obj.into())
188+
api().special_const_p(obj)
187189
}
188190

189191
/// Queries the type of the object.
@@ -404,6 +406,10 @@ pub unsafe fn SYM2ID(obj: VALUE) -> crate::ID {
404406
}
405407

406408
/// Alias for SYM2ID for compatibility with Ruby naming conventions.
409+
///
410+
/// # Safety
411+
/// - `obj` must be a valid Symbol VALUE
412+
/// - For dynamic symbols, this may access the heap
407413
#[inline(always)]
408414
pub unsafe fn RB_SYM2ID(obj: VALUE) -> crate::ID {
409415
api().sym2id(obj)

crates/rb-sys/src/stable_api/ruby_4_0.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ impl StableApiDefinition for Definition {
367367
#[inline]
368368
fn fixable(&self, val: std::os::raw::c_long) -> bool {
369369
// Check if value is within Fixnum range
370-
val >= crate::special_consts::FIXNUM_MIN && val <= crate::special_consts::FIXNUM_MAX
370+
(crate::special_consts::FIXNUM_MIN..=crate::special_consts::FIXNUM_MAX).contains(&val)
371371
}
372372

373373
#[inline]

examples/rust_reverse/ext/rust_reverse/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "rust_reverse"
3-
version = "0.9.123"
3+
version = "0.9.124"
44
autotests = true # set true if you want to use "cargo test"
55
edition = "2018"
66

77
[dependencies]
8-
rb-sys = { version = "0.9.123", path = "./../../../../crates/rb-sys", features = [
8+
rb-sys = { version = "0.9.124", path = "./../../../../crates/rb-sys", features = [
99
"global-allocator",
1010
] }
1111

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module RustReverse
4-
VERSION = "0.9.123"
4+
VERSION = "0.9.124"
55
end

gem/lib/rb_sys/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module RbSys
4-
VERSION = "0.9.123"
4+
VERSION = "0.9.124"
55
end

0 commit comments

Comments
 (0)