Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Integer#size in Rust #179

Closed
lopopolo opened this issue Aug 20, 2019 · 2 comments · Fixed by #212
Closed

Implement Integer#size in Rust #179

lopopolo opened this issue Aug 20, 2019 · 2 comments · Fixed by #212
Labels
A-core Area: Core traits and interpreter-agnostic Ruby Core and Ruby stdlib implementations. A-ruby-core Area: Ruby Core types. A-spec Area: ruby/spec infrastructure and completeness. E-easy Call for participation: Experience needed to fix: Easy / not much.

Comments

@lopopolo
Copy link
Member

One of the patches we carry to mspec works around the lack of an Integer#size implementation.

This function is easily implemented in Rust using artichoke_backend::types::Int and mem::size_of.

#[cfg(not(target_arch = "wasm32"))]
pub type Int = i64;
// wasm32 builds target 32-bit Ruby `Integer`s.
#[cfg(target_arch = "wasm32")]
pub type Int = i32;

@lopopolo lopopolo added E-easy Call for participation: Experience needed to fix: Easy / not much. A-core Area: Core traits and interpreter-agnostic Ruby Core and Ruby stdlib implementations. A-ruby-core Area: Ruby Core types. A-spec Area: ruby/spec infrastructure and completeness. labels Aug 20, 2019
@tkbky
Copy link
Contributor

tkbky commented Aug 28, 2019

I would like to give this a try.

@lopopolo
Copy link
Member Author

Sounds good thank you

lopopolo added a commit that referenced this issue Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core traits and interpreter-agnostic Ruby Core and Ruby stdlib implementations. A-ruby-core Area: Ruby Core types. A-spec Area: ruby/spec infrastructure and completeness. E-easy Call for participation: Experience needed to fix: Easy / not much.
Development

Successfully merging a pull request may close this issue.

2 participants