@@ -1121,11 +1121,11 @@ fn test_try_reserve() {
11211121 } else { panic ! ( "usize::MAX should trigger an overflow!" ) }
11221122 } else {
11231123 // Check isize::MAX + 1 is an OOM
1124- if let Err ( AllocErr ) = empty_bytes. try_reserve ( MAX_CAP + 1 ) {
1124+ if let Err ( AllocError { .. } ) = empty_bytes. try_reserve ( MAX_CAP + 1 ) {
11251125 } else { panic ! ( "isize::MAX + 1 should trigger an OOM!" ) }
11261126
11271127 // Check usize::MAX is an OOM
1128- if let Err ( AllocErr ) = empty_bytes. try_reserve ( MAX_USIZE ) {
1128+ if let Err ( AllocError { .. } ) = empty_bytes. try_reserve ( MAX_USIZE ) {
11291129 } else { panic ! ( "usize::MAX should trigger an OOM!" ) }
11301130 }
11311131 }
@@ -1145,7 +1145,7 @@ fn test_try_reserve() {
11451145 if let Err ( CapacityOverflow ) = ten_bytes. try_reserve ( MAX_CAP - 9 ) {
11461146 } else { panic ! ( "isize::MAX + 1 should trigger an overflow!" ) ; }
11471147 } else {
1148- if let Err ( AllocErr ) = ten_bytes. try_reserve ( MAX_CAP - 9 ) {
1148+ if let Err ( AllocError { .. } ) = ten_bytes. try_reserve ( MAX_CAP - 9 ) {
11491149 } else { panic ! ( "isize::MAX + 1 should trigger an OOM!" ) }
11501150 }
11511151 // Should always overflow in the add-to-len
@@ -1168,7 +1168,7 @@ fn test_try_reserve() {
11681168 if let Err ( CapacityOverflow ) = ten_u32s. try_reserve ( MAX_CAP /4 - 9 ) {
11691169 } else { panic ! ( "isize::MAX + 1 should trigger an overflow!" ) ; }
11701170 } else {
1171- if let Err ( AllocErr ) = ten_u32s. try_reserve ( MAX_CAP /4 - 9 ) {
1171+ if let Err ( AllocError { .. } ) = ten_u32s. try_reserve ( MAX_CAP /4 - 9 ) {
11721172 } else { panic ! ( "isize::MAX + 1 should trigger an OOM!" ) }
11731173 }
11741174 // Should fail in the mul-by-size
@@ -1209,10 +1209,10 @@ fn test_try_reserve_exact() {
12091209 if let Err ( CapacityOverflow ) = empty_bytes. try_reserve_exact ( MAX_USIZE ) {
12101210 } else { panic ! ( "usize::MAX should trigger an overflow!" ) }
12111211 } else {
1212- if let Err ( AllocErr ) = empty_bytes. try_reserve_exact ( MAX_CAP + 1 ) {
1212+ if let Err ( AllocError { .. } ) = empty_bytes. try_reserve_exact ( MAX_CAP + 1 ) {
12131213 } else { panic ! ( "isize::MAX + 1 should trigger an OOM!" ) }
12141214
1215- if let Err ( AllocErr ) = empty_bytes. try_reserve_exact ( MAX_USIZE ) {
1215+ if let Err ( AllocError { .. } ) = empty_bytes. try_reserve_exact ( MAX_USIZE ) {
12161216 } else { panic ! ( "usize::MAX should trigger an OOM!" ) }
12171217 }
12181218 }
@@ -1231,7 +1231,7 @@ fn test_try_reserve_exact() {
12311231 if let Err ( CapacityOverflow ) = ten_bytes. try_reserve_exact ( MAX_CAP - 9 ) {
12321232 } else { panic ! ( "isize::MAX + 1 should trigger an overflow!" ) ; }
12331233 } else {
1234- if let Err ( AllocErr ) = ten_bytes. try_reserve_exact ( MAX_CAP - 9 ) {
1234+ if let Err ( AllocError { .. } ) = ten_bytes. try_reserve_exact ( MAX_CAP - 9 ) {
12351235 } else { panic ! ( "isize::MAX + 1 should trigger an OOM!" ) }
12361236 }
12371237 if let Err ( CapacityOverflow ) = ten_bytes. try_reserve_exact ( MAX_USIZE ) {
@@ -1252,7 +1252,7 @@ fn test_try_reserve_exact() {
12521252 if let Err ( CapacityOverflow ) = ten_u32s. try_reserve_exact ( MAX_CAP /4 - 9 ) {
12531253 } else { panic ! ( "isize::MAX + 1 should trigger an overflow!" ) ; }
12541254 } else {
1255- if let Err ( AllocErr ) = ten_u32s. try_reserve_exact ( MAX_CAP /4 - 9 ) {
1255+ if let Err ( AllocError { .. } ) = ten_u32s. try_reserve_exact ( MAX_CAP /4 - 9 ) {
12561256 } else { panic ! ( "isize::MAX + 1 should trigger an OOM!" ) }
12571257 }
12581258 if let Err ( CapacityOverflow ) = ten_u32s. try_reserve_exact ( MAX_USIZE - 20 ) {
0 commit comments