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

Not able to build using rust 1.26 #11

Closed
JoshuaBatty opened this issue Jul 6, 2018 · 3 comments
Closed

Not able to build using rust 1.26 #11

JoshuaBatty opened this issue Jul 6, 2018 · 3 comments

Comments

@JoshuaBatty
Copy link

On rust version 1.26 I get the following error. When I updated to Rust 1.27 the error went away.

error[E0599]: no function or associated item named from_bits found for type f64 in the current scope
--> /Users/joshuabatty/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/half-1.1.1/src/lib.rs:808:9
|
808 | f64::from_bits(sign | exp | man)
| ^^^^^^^^^^^^^^ function or associated item not found in f64
|
= 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;

@Rua
Copy link

Rua commented Jul 12, 2018

I can confirm, I'm getting the same problem.

@VoidStarKat
Copy link
Owner

The last pull request changed some mem::transmutes into from_bits, which would've been fine for std, but I didn't realize from_bits only got moved to libcore in 1.27. Changed these back to mem::transmute and published 1.1.2 to prevent such a sudden breaking change.

@userzimmermann
Copy link

@starkat99 @JoshuaBatty @Rua FYI: I got the same issue when trying to build https://github.com/paulrouget/servoshell (which has rust-toolchain set to nightly-2017-11-14 -> rustc 1.23.0-nightly), but could basically solve it by just adding extern crate std;

And for my interest: Directly building half 3d17d44 with that fix and same toolchain (out of curiosity) nevertheless resulted in:

> cargo build
   Compiling half v1.1.1 (file:///C:/Users/userz/Projects/rust/half)
warning: unused extern crate
  --> src\lib.rs:36:1
   |
36 | extern crate std;
   | ^^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> src\lib.rs:26:32
   |
26 |         trivial_numeric_casts, unused_extern_crates, unused_import_braces, unused_qualifications)]
   |                                ^^^^^^^^^^^^^^^^^^^^

    Finished dev [unoptimized + debuginfo] target(s) in 0.56 secs

Can someone please explain this to me (why something that solves the problem on the other hand produces that warning)? I only have 2 days experience in Rust coding :D

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

4 participants