File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -526,3 +526,31 @@ impl Sealed for f64 {}
526
526
unsafe impl SimdElement for f64 {
527
527
type Mask = i64 ;
528
528
}
529
+
530
+ impl < T , const LANES : usize > Sealed for Simd < T , LANES >
531
+ where
532
+ T : SimdElement ,
533
+ LaneCount < LANES > : SupportedLaneCount ,
534
+ {
535
+ }
536
+
537
+ // FIXME(jubilee): This is a brutal hack for an "inherent associated type".
538
+ // It's not that bad, really, but neither is it necessary per se.
539
+
540
+ /// A trait describing a vector's associated scalar type.
541
+ /// This is just a hack around inherent associated types requiring lazy norm.
542
+ #[ doc( hidden) ]
543
+ pub trait Vector : Sealed {
544
+ /// A vector's associated scalar type.
545
+ #[ doc( hidden) ]
546
+ type Scalar : SimdElement ;
547
+ }
548
+
549
+ #[ doc( hidden) ]
550
+ impl < T , const LANES : usize > Vector for Simd < T , LANES >
551
+ where
552
+ T : SimdElement ,
553
+ LaneCount < LANES > : SupportedLaneCount ,
554
+ {
555
+ type Scalar = T ;
556
+ }
You can’t perform that action at this time.
0 commit comments