@@ -718,19 +718,29 @@ fn allow_max_capacity_arrayvec_type() {
718718 let _v: ArrayVec < ( ) , { usize:: MAX } > ;
719719}
720720
721- #[ should_panic( expected="index out of bounds " ) ]
721+ #[ should_panic( expected="largest supported capacity " ) ]
722722#[ test]
723723fn deny_max_capacity_arrayvec_value ( ) {
724724 if mem:: size_of :: < usize > ( ) <= mem:: size_of :: < u32 > ( ) {
725- panic ! ( "This test does not work on this platform. 'index out of bounds '" ) ;
725+ panic ! ( "This test does not work on this platform. 'largest supported capacity '" ) ;
726726 }
727727 // this type is allowed to be used (but can't be constructed)
728728 let _v: ArrayVec < ( ) , { usize:: MAX } > = ArrayVec :: new ( ) ;
729729}
730730
731+ #[ should_panic( expected="index out of bounds" ) ]
732+ #[ test]
733+ fn deny_max_capacity_arrayvec_value_const ( ) {
734+ if mem:: size_of :: < usize > ( ) <= mem:: size_of :: < u32 > ( ) {
735+ panic ! ( "This test does not work on this platform. 'index out of bounds'" ) ;
736+ }
737+ // this type is allowed to be used (but can't be constructed)
738+ let _v: ArrayVec < ( ) , { usize:: MAX } > = ArrayVec :: new_const ( ) ;
739+ }
740+
731741#[ test]
732742fn test_arrayvec_const_constructible ( ) {
733- const OF_U8 : ArrayVec < Vec < u8 > , 10 > = ArrayVec :: new ( ) ;
743+ const OF_U8 : ArrayVec < Vec < u8 > , 10 > = ArrayVec :: new_const ( ) ;
734744
735745 let mut var = OF_U8 ;
736746 assert ! ( var. is_empty( ) ) ;
@@ -742,7 +752,7 @@ fn test_arrayvec_const_constructible() {
742752
743753#[ test]
744754fn test_arraystring_const_constructible ( ) {
745- const AS : ArrayString < 10 > = ArrayString :: new ( ) ;
755+ const AS : ArrayString < 10 > = ArrayString :: new_const ( ) ;
746756
747757 let mut var = AS ;
748758 assert ! ( var. is_empty( ) ) ;
0 commit comments