Update for rustc
This commit is contained in:
parent
32f207881e
commit
7c415692c3
|
@ -21,7 +21,7 @@ arbitrary = ["quickcheck"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustc-serialize = "*"
|
rustc-serialize = "*"
|
||||||
rand = "0.1"
|
rand = "0.2"
|
||||||
|
|
||||||
[dependencies.quickcheck]
|
[dependencies.quickcheck]
|
||||||
optional = true
|
optional = true
|
||||||
|
|
|
@ -23,14 +23,14 @@ macro_rules! dvec_impl(
|
||||||
/// Slices this vector.
|
/// Slices this vector.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_slice<'a>(&'a self) -> &'a [N] {
|
pub fn as_slice<'a>(&'a self) -> &'a [N] {
|
||||||
self.at.slice_to(self.len())
|
&self.at[.. self.len()]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Mutably slices this vector.
|
/// Mutably slices this vector.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [N] {
|
pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [N] {
|
||||||
let len = self.len();
|
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, )* ];
|
let mut at: [N; $dim] = [ $( $zeros, )* ];
|
||||||
|
|
||||||
for n in at.slice_to_mut(dim).iter_mut() {
|
for n in &mut at[.. dim] {
|
||||||
*n = elem;
|
*n = elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -327,7 +327,7 @@ macro_rules! col_slice_impl(
|
||||||
fn col_slice(&self, cid: usize, rstart: usize, rend: usize) -> $slice<N> {
|
fn col_slice(&self, cid: usize, rstart: usize, rend: usize) -> $slice<N> {
|
||||||
let col = self.col(cid);
|
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> {
|
fn row_slice(&self, rid: usize, cstart: usize, cend: usize) -> $slice<N> {
|
||||||
let row = self.row(rid);
|
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])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,7 +14,7 @@ fn assert_approx_eq_f64() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_fail]
|
#[should_panic]
|
||||||
fn assert_approx_eq_vec2_f32_fail() {
|
fn assert_approx_eq_vec2_f32_fail() {
|
||||||
let a = Vec2::new(1.0f32, 0.0);
|
let a = Vec2::new(1.0f32, 0.0);
|
||||||
let b = Vec2::new(1.1f32, 0.1);
|
let b = Vec2::new(1.1f32, 0.1);
|
||||||
|
@ -28,7 +28,7 @@ fn assert_approx_eq_eps_f32() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_fail]
|
#[should_panic]
|
||||||
fn assert_approx_eq_eps_f64_fail() {
|
fn assert_approx_eq_eps_f64_fail() {
|
||||||
assert_approx_eq_eps!(1.0f64, 1.1, 0.05);
|
assert_approx_eq_eps!(1.0f64, 1.1, 0.05);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ fn assert_approx_eq_ulps_f32() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_fail]
|
#[should_panic]
|
||||||
fn assert_approx_eq_ulps_f32_fail() {
|
fn assert_approx_eq_ulps_f32_fail() {
|
||||||
let x = 1000000_f32;
|
let x = 1000000_f32;
|
||||||
let y = 1000000.1_f32;
|
let y = 1000000.1_f32;
|
||||||
|
@ -59,7 +59,7 @@ fn assert_approx_eq_ulps_f64() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_fail]
|
#[should_panic]
|
||||||
fn assert_approx_eq_ulps_f64_fail() {
|
fn assert_approx_eq_ulps_f64_fail() {
|
||||||
let x = 1000000_f64;
|
let x = 1000000_f64;
|
||||||
let y = 1000000.0000000003_f64;
|
let y = 1000000.0000000003_f64;
|
||||||
|
|
Loading…
Reference in New Issue