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

Missing use core::num::Float? #149

Closed
ezavod opened this issue Sep 17, 2018 · 4 comments
Closed

Missing use core::num::Float? #149

ezavod opened this issue Sep 17, 2018 · 4 comments

Comments

@ezavod
Copy link

ezavod commented Sep 17, 2018

Can't compile with rustc 1.26.2 stable on OpenSUSE Tumbleweed 64bit because I get errors like:

error[E0599]: no function or associated item named `from_bits` found for type `f32` in the current scope
 --> libm/src/math/tanhf.rs:9:9
  |
9 |     x = f32::from_bits(ix);
  |         ^^^^^^^^^^^^^^ function or associated item not found in `f32`
  |
  = help: items from traits can only be used if the trait is in scope
  = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
          candidate #1: `use core::num::Float;

Temporarily fixed by use core::num::Float;.

@HadrienG2
Copy link

HadrienG2 commented Sep 18, 2018

Same issue here. I'm not sure why this happens though, as these functions should actually exist in std, and AFAIK there is no obvious reason why they should not exist in a no_std crate.

Perhaps a rustc bug report is in order?

@HadrienG2
Copy link

Mmm... it does work with rustc 1.28 installed via rustup, so the problem seems to originate from either 1.26 or the Tumbleweed package. Let's investigate further...

@HadrienG2
Copy link

Alright, the Rust toolchain version is the issue. 1.26.2 installed via rustup doesn't work, 1.27.0 installed via rustup does work. The relevant functionality was likely introduced by this PR during the 1.27 release cycle.

So... I guess Tumbleweed users will need to use rustup for now if they want to use the libm crate or a crate that indirectly depends on it like nalgebra.

@ezavod
Copy link
Author

ezavod commented Sep 19, 2018

@HadrienG2 Thanks for your investigation of this issue.
I also got it to work after fiddling around with different versions of the rust toolchain.

So I will leave this open for now and close it as soon as the working version landed officially.

@ezavod ezavod closed this as completed Nov 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants