Update for rustc

This commit is contained in:
Pierre Krieger 2015-03-23 14:30:31 +01:00
parent 32f207881e
commit 7c415692c3
4 changed files with 10 additions and 10 deletions

View File

@ -21,7 +21,7 @@ arbitrary = ["quickcheck"]
[dependencies]
rustc-serialize = "*"
rand = "0.1"
rand = "0.2"
[dependencies.quickcheck]
optional = true

View File

@ -23,14 +23,14 @@ macro_rules! dvec_impl(
/// Slices this vector.
#[inline]
pub fn as_slice<'a>(&'a self) -> &'a [N] {
self.at.slice_to(self.len())
&self.at[.. self.len()]
}
/// Mutably slices this vector.
#[inline]
pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [N] {
let len = self.len();
self.at.slice_to_mut(len)
&mut self.at[.. len]
}
}
@ -443,7 +443,7 @@ macro_rules! small_dvec_from_impl (
let mut at: [N; $dim] = [ $( $zeros, )* ];
for n in at.slice_to_mut(dim).iter_mut() {
for n in &mut at[.. dim] {
*n = elem;
}

View File

@ -327,7 +327,7 @@ macro_rules! col_slice_impl(
fn col_slice(&self, cid: usize, rstart: usize, rend: usize) -> $slice<N> {
let col = self.col(cid);
$slice::from_slice(rend - rstart, col.as_array().slice(rstart, rend))
$slice::from_slice(rend - rstart, &col.as_array()[rstart .. rend])
}
}
)
@ -368,7 +368,7 @@ macro_rules! row_slice_impl(
fn row_slice(&self, rid: usize, cstart: usize, cend: usize) -> $slice<N> {
let row = self.row(rid);
$slice::from_slice(cend - cstart, row.as_array().slice(cstart, cend))
$slice::from_slice(cend - cstart, &row.as_array()[cstart .. cend])
}
}
)

View File

@ -14,7 +14,7 @@ fn assert_approx_eq_f64() {
}
#[test]
#[should_fail]
#[should_panic]
fn assert_approx_eq_vec2_f32_fail() {
let a = Vec2::new(1.0f32, 0.0);
let b = Vec2::new(1.1f32, 0.1);
@ -28,7 +28,7 @@ fn assert_approx_eq_eps_f32() {
}
#[test]
#[should_fail]
#[should_panic]
fn assert_approx_eq_eps_f64_fail() {
assert_approx_eq_eps!(1.0f64, 1.1, 0.05);
}
@ -43,7 +43,7 @@ fn assert_approx_eq_ulps_f32() {
}
#[test]
#[should_fail]
#[should_panic]
fn assert_approx_eq_ulps_f32_fail() {
let x = 1000000_f32;
let y = 1000000.1_f32;
@ -59,7 +59,7 @@ fn assert_approx_eq_ulps_f64() {
}
#[test]
#[should_fail]
#[should_panic]
fn assert_approx_eq_ulps_f64_fail() {
let x = 1000000_f64;
let y = 1000000.0000000003_f64;