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

no_std support is broken #125

Closed
sajattack opened this issue Feb 27, 2019 · 4 comments · Fixed by #127
Closed

no_std support is broken #125

sajattack opened this issue Feb 27, 2019 · 4 comments · Fixed by #127
Labels
defect Something that isn't as or doesn't work as intended

Comments

@sajattack
Copy link

I tried using this crate in a no_std context and it doesn't work because the inclusion of num_traits::Float isn't behind a feature flag, and evidently, the stuff behind the libm_works feature flag doesn't "work".

@Ogeon
Copy link
Owner

Ogeon commented Feb 27, 2019

Thanks for pointing it out! It's supposed to not be broken, if i remember correctly. Can you provide a bit more information to make it easier to reproduce your situation? That would help a lot in figuring out why it stopped working. At least

  • which target you are compiling against,
  • which palette feature set you have enabled,
  • and the errors the compiler prints.

A minimal example project would be the best, if possible. It doesn't have to do anything meaningful.

@sajattack
Copy link
Author

sajattack commented Feb 27, 2019

  • thumbv6m-none-eabi
  • default-features=false, named
error[E0432]: unresolved import `num_traits::Float`
  --> /home/paul/.cargo/git/checkouts/palette-3cb107dfe0152157/1342cce/palette/src/float.rs:12:9
   |
12 | pub use num_traits::Float;
   |         ^^^^^^^^^^^^^^^^^ no `Float` in the root. Did you mean to use `float`?

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `palette`.
warning: build failed, waiting for other jobs to finish...
error: build failed

num_traits::Float is std-only.

As far as an example project to reproduce, just make a no_std project with palette in Cargo.toml.

@Ogeon
Copy link
Owner

Ogeon commented Feb 27, 2019

Thanks for the details! I suppose you are using the 2018 edition? Not that I think it makes a difference, but who knows? What you provided should definitely be enough. 👍

I can't say off the top of my head why this wasn't a problem half a year ago. It seems to have been std only for over a year.

@Ogeon Ogeon added the defect Something that isn't as or doesn't work as intended label Feb 27, 2019
@sajattack
Copy link
Author

Yes, 2018 edition.

@evq evq mentioned this issue Mar 20, 2019
bors bot added a commit that referenced this issue Apr 4, 2019
127: fix no_std r=Ogeon a=evq

fixes #125

Co-authored-by: eV <ev@7pr.xyz>
@bors bors bot closed this as completed in #127 Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something that isn't as or doesn't work as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants