diff --git a/src/approx.rs b/src/approx.rs index 72deb3a..13cc2dc 100644 --- a/src/approx.rs +++ b/src/approx.rs @@ -49,7 +49,7 @@ macro_rules! assert_approx_eq_eps( let eps = &($eps); let (given_val, expected_val) = (&($given), &($expected)); if !given_val.approx_eq_eps(expected_val, eps) { - fail!("assertion failed: `left ≈ right` (left: `{}`, right: `{}`, tolerance: `{}`)", + panic!("assertion failed: `left ≈ right` (left: `{}`, right: `{}`, tolerance: `{}`)", *given_val, *expected_val, *eps ) } @@ -61,7 +61,7 @@ macro_rules! assert_approx_eq( ($given: expr, $expected: expr) => ({ let (given_val, expected_val) = (&($given), &($expected)); if !given_val.approx_eq(expected_val) { - fail!("assertion failed: `left ≈ right` (left: `{}`, right: `{}`, tolerance: `{}`)", + panic!("assertion failed: `left ≈ right` (left: `{}`, right: `{}`, tolerance: `{}`)", *given_val, *expected_val, ApproxEq::approx_epsilon(Some(*given_val)) ) diff --git a/src/matrix.rs b/src/matrix.rs index 4054388..4f5df4f 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -422,7 +422,7 @@ impl FixedArray<[[S, ..2], ..2]> for Matrix2 { // y: FixedArray::from_fixed(y), // }, // } - fail!("Unimplemented, pending a fix for rust-lang/rust#16418") + panic!("Unimplemented, pending a fix for rust-lang/rust#16418") } #[inline] @@ -502,7 +502,7 @@ impl FixedArray<[[S, ..3], ..3]> for Matrix3 { // z: FixedArray::from_fixed(z), // }, // } - fail!("Unimplemented, pending a fix for rust-lang/rust#16418") + panic!("Unimplemented, pending a fix for rust-lang/rust#16418") } #[inline] @@ -587,7 +587,7 @@ impl FixedArray<[[S, ..4], ..4]> for Matrix4 { // w: FixedArray::from_fixed(w), // }, // } - fail!("Unimplemented, pending a fix for rust-lang/rust#16418") + panic!("Unimplemented, pending a fix for rust-lang/rust#16418") } #[inline] @@ -1095,7 +1095,7 @@ impl Matrix> for Matrix4 { 3 => Matrix3::from_cols(t.x.truncate_n(j), t.y.truncate_n(j), t.z.truncate_n(j)), - _ => fail!("out of range") + _ => panic!("out of range") }; let sign = if (i+j) & 1 == 1 {-one} else {one}; mat.determinant() * sign * inv_det diff --git a/src/plane.rs b/src/plane.rs index 191f0a1..1de0153 100644 --- a/src/plane.rs +++ b/src/plane.rs @@ -111,13 +111,13 @@ impl Intersect>> for (Plane, Ray3) { impl Intersect>> for (Plane, Plane) { fn intersection(&self) -> Option> { - fail!("Not yet implemented"); + panic!("Not yet implemented"); } } impl Intersect>> for (Plane, Plane, Plane) { fn intersection(&self) -> Option> { - fail!("Not yet implemented"); + panic!("Not yet implemented"); } } diff --git a/src/point.rs b/src/point.rs index 2f01e11..6667781 100644 --- a/src/point.rs +++ b/src/point.rs @@ -121,7 +121,7 @@ impl FixedArray<[S, ..2]> for Point2 { #[inline] fn from_fixed(_v: [S, ..2]) -> Point2 { // match v { [x, y] => Point2 { x: x, y: y } } - fail!("Unimplemented, pending a fix for rust-lang/rust#16418") + panic!("Unimplemented, pending a fix for rust-lang/rust#16418") } #[inline] @@ -275,7 +275,7 @@ impl FixedArray<[S, ..3]> for Point3 { #[inline] fn from_fixed(_v: [S, ..3]) -> Point3 { // match v { [x, y, z] => Point3 { x: x, y: y, z: z } } - fail!("Unimplemented, pending a fix for rust-lang/rust#16418") + panic!("Unimplemented, pending a fix for rust-lang/rust#16418") } #[inline] diff --git a/src/vector.rs b/src/vector.rs index 9922860..27f71e0 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -231,7 +231,7 @@ macro_rules! vec( #[inline] fn from_fixed(_v: [$S, ..$n]) -> $Self<$S> { // match v { [$($field),+] => $Self { $($field: $field),+ } } - fail!("Unimplemented, pending a fix for rust-lang/rust#16418") + panic!("Unimplemented, pending a fix for rust-lang/rust#16418") } #[inline] @@ -438,7 +438,7 @@ impl Vector4 { 1 => Vector3::new(self.x, self.z, self.w), 2 => Vector3::new(self.x, self.y, self.w), 3 => Vector3::new(self.x, self.y, self.z), - _ => fail!("{} is out of range", n) + _ => panic!("{} is out of range", n) } } } diff --git a/tests/quaternion.rs b/tests/quaternion.rs index 3f64b68..781e6fe 100644 --- a/tests/quaternion.rs +++ b/tests/quaternion.rs @@ -43,7 +43,7 @@ fn to_and_from_quaternion() if !(ax.approx_eq_eps(&bx, &0.001) && ay.approx_eq_eps(&by, &0.001) && az.approx_eq_eps(&bz, &0.001)) { - fail!("{} != {}", a, b) + panic!("{} != {}", a, b) } }