]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_arena/src/tests.rs
Auto merge of #2698 - RalfJung:miri-in-rustc, r=oli-obk
[rust.git] / compiler / rustc_arena / src / tests.rs
index ad61464343a4a852194420160d717d19e1c6b8ac..49a070badc6de5c30c6cbd4b81b0407b970d9621 100644 (file)
@@ -52,19 +52,15 @@ enum EI<'e> {
 
     impl<'a> Wrap<'a> {
         fn alloc_inner<F: Fn() -> Inner>(&self, f: F) -> &Inner {
-            let r: &EI<'_> = self.0.alloc(EI::I(f()));
-            if let &EI::I(ref i) = r {
-                i
-            } else {
-                panic!("mismatch");
+            match self.0.alloc(EI::I(f())) {
+                EI::I(i) => i,
+                _ => panic!("mismatch"),
             }
         }
         fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer<'_> {
-            let r: &EI<'_> = self.0.alloc(EI::O(f()));
-            if let &EI::O(ref o) = r {
-                o
-            } else {
-                panic!("mismatch");
+            match self.0.alloc(EI::O(f())) {
+                EI::O(o) => o,
+                _ => panic!("mismatch"),
             }
         }
     }