diff options
| author | Max Bernstein <ruby@bernsteinbear.com> | 2025-10-24 18:34:32 -0700 |
|---|---|---|
| committer | Max Bernstein <tekknolagi@gmail.com> | 2025-10-28 10:49:30 -0400 |
| commit | a4f8afcec835401d356350ad4a20a78b9aaa30f2 (patch) | |
| tree | ecfbec215e8d7459fbf40692871ea1069260d746 | |
| parent | 2a6e5d7d94103f73d56c8d6f1393eb5b4c7297d1 (diff) | |
ZJIT: Use FnProperties::default()
| -rw-r--r-- | zjit/src/cruby_methods.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/zjit/src/cruby_methods.rs b/zjit/src/cruby_methods.rs index 51841d6f78..b434cfe25a 100644 --- a/zjit/src/cruby_methods.rs +++ b/zjit/src/cruby_methods.rs @@ -156,20 +156,22 @@ pub fn init() -> Annotations { macro_rules! annotate { ($module:ident, $method_name:literal, $inline:ident) => { - let props = FnProperties { no_gc: false, leaf: false, elidable: false, return_type: types::BasicObject, inline: $inline }; + let mut props = FnProperties::default(); + props.inline = $inline; annotate_c_method(cfuncs, unsafe { $module }, $method_name, props); }; ($module:ident, $method_name:literal, $inline:ident, $return_type:expr $(, $properties:ident)*) => { - #[allow(unused_mut)] - let mut props = FnProperties { no_gc: false, leaf: false, elidable: false, return_type: $return_type, inline: $inline }; + let mut props = FnProperties::default(); + props.return_type = $return_type; + props.inline = $inline; $( props.$properties = true; )* annotate_c_method(cfuncs, unsafe { $module }, $method_name, props); }; ($module:ident, $method_name:literal, $return_type:expr $(, $properties:ident)*) => { - #[allow(unused_mut)] - let mut props = FnProperties { no_gc: false, leaf: false, elidable: false, return_type: $return_type, inline: no_inline }; + let mut props = FnProperties::default(); + props.return_type = $return_type; $( props.$properties = true; )* @@ -183,13 +185,8 @@ pub fn init() -> Annotations { annotate_builtin!($module, $method_name, $return_type, no_gc, leaf, elidable) }; ($module:ident, $method_name:literal, $return_type:expr, $($properties:ident),+) => { - let mut props = FnProperties { - no_gc: false, - leaf: false, - elidable: false, - return_type: $return_type, - inline: no_inline, - }; + let mut props = FnProperties::default(); + props.return_type = $return_type; $(props.$properties = true;)+ annotate_builtin_method(builtin_funcs, unsafe { $module }, $method_name, props); } |
