Avoid and remove some unstable features.
The only #[feature] left for now is the bencher.
This commit is contained in:
parent
80b6f92c4e
commit
24d2f15ccf
|
@ -38,14 +38,13 @@
|
|||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#![feature(core)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate num;
|
||||
extern crate test;
|
||||
|
||||
use std::str::FromStr;
|
||||
use std::num::{FromPrimitive, ToPrimitive};
|
||||
use num::traits::{FromPrimitive, ToPrimitive};
|
||||
|
||||
use test::Bencher;
|
||||
|
||||
|
@ -133,7 +132,7 @@ fn main() {
|
|||
let n = if args.len() < 2 {
|
||||
DEFAULT_DIGITS
|
||||
} else {
|
||||
FromStr::from_str(args[1].as_slice()).unwrap()
|
||||
FromStr::from_str(&args[1]).unwrap()
|
||||
};
|
||||
pidigits(n);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
//! approximate a square root to arbitrary precision:
|
||||
//!
|
||||
//! ```
|
||||
//! # #![feature(core)]
|
||||
//! extern crate num;
|
||||
//!
|
||||
//! use num::FromPrimitive;
|
||||
|
@ -44,7 +43,7 @@
|
|||
//!
|
||||
//! [newt]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
|
||||
//#![cfg_attr(test, deny(warnings))]
|
||||
#![cfg_attr(test, feature(hash, test))]
|
||||
#![cfg_attr(test, feature(test))]
|
||||
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
||||
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
||||
html_root_url = "http://doc.rust-lang.org/num/",
|
||||
|
@ -145,5 +144,8 @@ pub fn pow<T: Clone + One + Mul<T, Output = T>>(mut base: T, mut exp: usize) ->
|
|||
|
||||
#[cfg(test)]
|
||||
fn hash<T: hash::Hash>(x: &T) -> u64 {
|
||||
hash::hash::<T, hash::SipHasher>(x)
|
||||
use std::hash::Hasher;
|
||||
let mut hasher = hash::SipHasher::new();
|
||||
x.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
}
|
||||
|
|
|
@ -1329,8 +1329,8 @@ pub trait Float
|
|||
/// predicate instead.
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(core)]
|
||||
/// use std::num::{Float, FpCategory};
|
||||
/// use num::traits::Float;
|
||||
/// use std::num::FpCategory;
|
||||
/// use std::f32;
|
||||
///
|
||||
/// let num = 12.4f32;
|
||||
|
@ -1880,7 +1880,6 @@ pub trait Float
|
|||
/// the operations were performed separately.
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(std_misc, core)]
|
||||
/// use num::traits::Float;
|
||||
/// use std::f64;
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue