Avoid and remove some unstable features.

The only #[feature] left for now is the bencher.
This commit is contained in:
kennytm 2015-04-05 02:57:17 +08:00
parent 80b6f92c4e
commit 24d2f15ccf
3 changed files with 9 additions and 9 deletions

View File

@ -38,14 +38,13 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE. // OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(core)]
#![feature(test)] #![feature(test)]
extern crate num; extern crate num;
extern crate test; extern crate test;
use std::str::FromStr; use std::str::FromStr;
use std::num::{FromPrimitive, ToPrimitive}; use num::traits::{FromPrimitive, ToPrimitive};
use test::Bencher; use test::Bencher;
@ -133,7 +132,7 @@ fn main() {
let n = if args.len() < 2 { let n = if args.len() < 2 {
DEFAULT_DIGITS DEFAULT_DIGITS
} else { } else {
FromStr::from_str(args[1].as_slice()).unwrap() FromStr::from_str(&args[1]).unwrap()
}; };
pidigits(n); pidigits(n);
} }

View File

@ -18,7 +18,6 @@
//! approximate a square root to arbitrary precision: //! approximate a square root to arbitrary precision:
//! //!
//! ``` //! ```
//! # #![feature(core)]
//! extern crate num; //! extern crate num;
//! //!
//! use num::FromPrimitive; //! use num::FromPrimitive;
@ -44,7 +43,7 @@
//! //!
//! [newt]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method //! [newt]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
//#![cfg_attr(test, deny(warnings))] //#![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", #![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_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/num/", 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)] #[cfg(test)]
fn hash<T: hash::Hash>(x: &T) -> u64 { 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()
} }

View File

@ -1329,8 +1329,8 @@ pub trait Float
/// predicate instead. /// predicate instead.
/// ///
/// ``` /// ```
/// # #![feature(core)] /// use num::traits::Float;
/// use std::num::{Float, FpCategory}; /// use std::num::FpCategory;
/// use std::f32; /// use std::f32;
/// ///
/// let num = 12.4f32; /// let num = 12.4f32;
@ -1880,7 +1880,6 @@ pub trait Float
/// the operations were performed separately. /// the operations were performed separately.
/// ///
/// ``` /// ```
/// # #![feature(std_misc, core)]
/// use num::traits::Float; /// use num::traits::Float;
/// use std::f64; /// use std::f64;
/// ///