-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fix no_std build failure #138
Conversation
I have no idea what's going on here tbh. #[cfg(not(test))]
use libm::{F32Ext, F64Ext}; spits out
|
Hmm... strange, but good catch! I wonder how it passed the tests in the first place. Did you compile with any specific feature set, or just all of them disabled? Either way, the float trait business is a bit weird and convoluted, but take a look in the |
Because the tests are always built with std. You can't run tests with no_std. The only way to appropriately check for no_std compatibility is to |
Oh, right! I forgot about that. 🤦♂️ Classic and not so strange after all. Do you think you can add a compile test in the |
Unfortunately this gets even harder because the lock file also contains the dev dependencies which make the command I posted also not work due to the cargo bug where features of dev dependencies leak into your normal dependencies. So we would need a separate crate specifically to test no_std compatibility that depends on palette. The state of no_std in Rust is honestly still pretty sad tbh. |
That's annoying. One would think the dev dependencies would be isolated. In that case it may be better if it's added in a separate issue and PR, to keep the scope of this one focused. I have obviously not investigated the general no_std situation enough, but I suppose it would be good to try to test for it not being leaked, too. So it's doesn't sound like a quick addition. |
{f32|f64}::round() does not exist with just core, so libm's implementation is used instead when the `std` feature is not activated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! There's just that one import that doesn't need to be in lib.rs. 🙂
Too late, that's already gone :P |
You are too fast for me 😁 I guess that's why it seemed to glitch a bit when I started the review. |
The builds look good so far, so I'll approve this. I'll also create an issue for setting up no_std tests. |
bors r+ |
Build succeeded |
{f32|f64}::round() does not exist with just core, so libm's implementation is used instead when the
std
feature is not activated.