@@ -1771,8 +1771,9 @@ where
1771
1771
/// broadcast them as array views into that shape.
1772
1772
///
1773
1773
/// Return `ShapeError` if their shapes can not be broadcast together.
1774
+ #[ allow( clippy:: type_complexity) ]
1774
1775
pub ( crate ) fn broadcast_with < ' a , ' b , B , S2 , E > ( & ' a self , other : & ' b ArrayBase < S2 , E > ) ->
1775
- Result < ( ArrayView < ' a , A , < D as DimMax < E > >:: Output > , ArrayView < ' b , B , < D as DimMax < E > > :: Output > ) , ShapeError >
1776
+ Result < ( ArrayView < ' a , A , DimMaxOf < D , E > > , ArrayView < ' b , B , DimMaxOf < D , E > > ) , ShapeError >
1776
1777
where
1777
1778
S : Data < Elem =A > ,
1778
1779
S2 : Data < Elem =B > ,
@@ -1782,10 +1783,10 @@ where
1782
1783
let shape = co_broadcast :: < D , E , <D as DimMax < E > >:: Output > ( & self . dim , & other. dim ) ?;
1783
1784
if let Some ( view1) = self . broadcast ( shape. clone ( ) ) {
1784
1785
if let Some ( view2) = other. broadcast ( shape) {
1785
- return Ok ( ( view1, view2) )
1786
+ return Ok ( ( view1, view2) ) ;
1786
1787
}
1787
1788
}
1788
- return Err ( from_kind ( ErrorKind :: IncompatibleShape ) ) ;
1789
+ Err ( from_kind ( ErrorKind :: IncompatibleShape ) )
1789
1790
}
1790
1791
1791
1792
/// Swap axes `ax` and `bx`.
@@ -2465,3 +2466,5 @@ unsafe fn unlimited_transmute<A, B>(data: A) -> B {
2465
2466
let old_data = ManuallyDrop :: new ( data) ;
2466
2467
( & * old_data as * const A as * const B ) . read ( )
2467
2468
}
2469
+
2470
+ type DimMaxOf < A , B > = <A as DimMax < B > >:: Output ;
0 commit comments