rust-in-action / code

Source code for the book Rust in Action
https://www.manning.com/books/rust-in-action?a_aid=rust&a_bid=0367c58f&chan=github
1.9k stars 445 forks source link

ch2-complex - use of unstable library feature 'dec2flt': internal routines only exposed for testing #81

Closed ryukato closed 2 years ago

ryukato commented 2 years ago

I am new to Rust but when I run the chapter 2-complex example codes, then there is an error like below.

error[E0658]: use of unstable library feature 'dec2flt': internal routines only exposed for testing
 --> src/main.rs:1:5
  |
1 | use core::num::dec2flt::number;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

Rust & Cargo version

ryukato commented 2 years ago

I found dec2flt This feature is internal to the Rust compiler and is not intended for general use. from https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/unstable-book/print.html#dec2flt. However, then is there any other way, not to use num::complex?

ryukato commented 2 years ago

Oh sorry I found what problem is. it has to be edition = "2018".