about summary refs log tree commit diff
path: root/src/liballoc/tests/string.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-04-03 16:01:29 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-04-12 22:53:13 +0200
commit93a9ad4897e560ccd5ebc3397afb7d83d990ef42 (patch)
tree9712baa4ee6bf075c039b61a216351ea7777977e /src/liballoc/tests/string.rs
parent157ff8cd0562eefdd7aa296395c38a7bc259a4b9 (diff)
downloadrust-93a9ad4897e560ccd5ebc3397afb7d83d990ef42.tar.gz
rust-93a9ad4897e560ccd5ebc3397afb7d83d990ef42.zip
Remove the now-unit-struct AllocErr field inside CollectionAllocErr
Diffstat (limited to 'src/liballoc/tests/string.rs')
-rw-r--r--src/liballoc/tests/string.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/tests/string.rs b/src/liballoc/tests/string.rs
index 17d53e4cf3e..befb36baeef 100644
--- a/src/liballoc/tests/string.rs
+++ b/src/liballoc/tests/string.rs
@@ -575,11 +575,11 @@ fn test_try_reserve() {
             } else { panic!("usize::MAX should trigger an overflow!") }
         } else {
             // Check isize::MAX + 1 is an OOM
-            if let Err(AllocErr(_)) = empty_string.try_reserve(MAX_CAP + 1) {
+            if let Err(AllocErr) = empty_string.try_reserve(MAX_CAP + 1) {
             } else { panic!("isize::MAX + 1 should trigger an OOM!") }
 
             // Check usize::MAX is an OOM
-            if let Err(AllocErr(_)) = empty_string.try_reserve(MAX_USIZE) {
+            if let Err(AllocErr) = empty_string.try_reserve(MAX_USIZE) {
             } else { panic!("usize::MAX should trigger an OOM!") }
         }
     }
@@ -599,7 +599,7 @@ fn test_try_reserve() {
             if let Err(CapacityOverflow) = ten_bytes.try_reserve(MAX_CAP - 9) {
             } else { panic!("isize::MAX + 1 should trigger an overflow!"); }
         } else {
-            if let Err(AllocErr(_)) = ten_bytes.try_reserve(MAX_CAP - 9) {
+            if let Err(AllocErr) = ten_bytes.try_reserve(MAX_CAP - 9) {
             } else { panic!("isize::MAX + 1 should trigger an OOM!") }
         }
         // Should always overflow in the add-to-len
@@ -637,10 +637,10 @@ fn test_try_reserve_exact() {
             if let Err(CapacityOverflow) = empty_string.try_reserve_exact(MAX_USIZE) {
             } else { panic!("usize::MAX should trigger an overflow!") }
         } else {
-            if let Err(AllocErr(_)) = empty_string.try_reserve_exact(MAX_CAP + 1) {
+            if let Err(AllocErr) = empty_string.try_reserve_exact(MAX_CAP + 1) {
             } else { panic!("isize::MAX + 1 should trigger an OOM!") }
 
-            if let Err(AllocErr(_)) = empty_string.try_reserve_exact(MAX_USIZE) {
+            if let Err(AllocErr) = empty_string.try_reserve_exact(MAX_USIZE) {
             } else { panic!("usize::MAX should trigger an OOM!") }
         }
     }
@@ -659,7 +659,7 @@ fn test_try_reserve_exact() {
             if let Err(CapacityOverflow) = ten_bytes.try_reserve_exact(MAX_CAP - 9) {
             } else { panic!("isize::MAX + 1 should trigger an overflow!"); }
         } else {
-            if let Err(AllocErr(_)) = ten_bytes.try_reserve_exact(MAX_CAP - 9) {
+            if let Err(AllocErr) = ten_bytes.try_reserve_exact(MAX_CAP - 9) {
             } else { panic!("isize::MAX + 1 should trigger an OOM!") }
         }
         if let Err(CapacityOverflow) = ten_bytes.try_reserve_exact(MAX_USIZE) {