@@ -111,7 +111,9 @@ use num::{BaseNum, BaseFloat};
111
111
/// A trait that specifies a range of numeric operations for vectors. Not all
112
112
/// of these make sense from a linear algebra point of view, but are included
113
113
/// for pragmatic reasons.
114
- pub trait Vector : Array1 < Element = <Self as Vector >:: Scalar > + Clone // where
114
+ pub trait Vector : Clone where
115
+ // FIXME: Ugly type signatures - blocked by rust-lang/rust#24092
116
+ Self : Array1 < Element = <Self as Vector >:: Scalar > ,
115
117
// FIXME: blocked by rust-lang/rust#20671
116
118
//
117
119
// for<'a, 'b> &'a Self: Add<&'b Self, Output = Self>,
@@ -627,6 +629,7 @@ impl<S: BaseNum> Vector4<S> {
627
629
/// Specifies geometric operations for vectors. This is only implemented for
628
630
/// 2-dimensional and 3-dimensional vectors.
629
631
pub trait EuclideanVector : Vector + Sized where
632
+ // FIXME: Ugly type signatures - blocked by rust-lang/rust#24092
630
633
<Self as Vector >:: Scalar : BaseFloat ,
631
634
Self : ApproxEq < Epsilon = <Self as Vector >:: Scalar > ,
632
635
{
@@ -647,6 +650,7 @@ pub trait EuclideanVector: Vector + Sized where
647
650
/// The norm of the vector.
648
651
#[ inline]
649
652
fn length ( & self ) -> Self :: Scalar {
653
+ // Not sure why these annotations are needed
650
654
<<Self as Vector >:: Scalar as :: rust_num:: Float >:: sqrt ( self . dot ( self ) )
651
655
}
652
656
@@ -679,6 +683,7 @@ pub trait EuclideanVector: Vector + Sized where
679
683
/// Normalises the vector to a length of `1`.
680
684
#[ inline]
681
685
fn normalize_self ( & mut self ) {
686
+ // Not sure why these annotations are needed
682
687
let rlen = <<Self as Vector >:: Scalar as :: rust_num:: Float >:: recip ( self . length ( ) ) ;
683
688
self . mul_self_s ( rlen) ;
684
689
}
0 commit comments