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

Methods of floating point types are not available for #![no_std] #47798

Closed
upsuper opened this issue Jan 27, 2018 · 1 comment
Closed

Methods of floating point types are not available for #![no_std] #47798

upsuper opened this issue Jan 27, 2018 · 1 comment

Comments

@upsuper
Copy link
Contributor

upsuper commented Jan 27, 2018

The following code

#![no_std]

fn main() {
    let a = 1.0f32;
    let _ = a.is_finite();
}

doesn't compile. It reports:

error[E0599]: no method named `is_finite` found for type `f32` in the current scope
 --> src/main.rs:5:15
  |
5 |     let _ = a.is_finite();
  |               ^^^^^^^^^
  |
  = 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;`

but core::num::Float is not yet stable.

The implementations of the methods should probably be moved to core rather than staying in std.

@upsuper
Copy link
Contributor Author

upsuper commented Jan 27, 2018

Looking at #27823, it seems they are intentionally moved out from libcore, so this issue is probably invalid.

@upsuper upsuper closed this as completed Jan 27, 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

1 participant