diff --git a/src/lib.rs b/src/lib.rs index 2626361051..520ebb41f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -396,11 +396,13 @@ impl Copy for GenericArrayImplOdd {} impl Sealed for GenericArrayImplEven {} impl Sealed for GenericArrayImplOdd {} -// 1 << (size_of::() << 3) == usize::MAX + 1 -type MaxArrayLengthP1 = typenum::Shleft< - typenum::U1, - typenum::Shleft() }>, typenum::U3>, ->; +// (256 ^ size_of::()) == usize::MAX + 1 +// +// We've previously used `1 << (size_of::() << 3)` here. However +// typenum's implementation of `N << M` requires a recursion depth of `log_2(N) + 2M` +// causing uses of this type to hit the default recursion limit of `128`. +type MaxArrayLengthP1 = + () }>>>::Output; /// Helper trait to hide the complex bound under a simpler name trait IsWithinUsizeBound: typenum::IsLess {}