about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-10 13:11:54 -0700
committerbors <bors@rust-lang.org>2014-04-10 13:11:54 -0700
commit5bcb76181a3b0df2df5ade348af3a1d29fca795e (patch)
treee476abb17b40370bd4f89d1a00d93236fbacd44b /src/libstd
parente263ef1df7b892ed29e53313565eb05ab75e52f4 (diff)
parent4b9a7a2588798ab4ffaa4805397fa428348d6a2a (diff)
downloadrust-5bcb76181a3b0df2df5ade348af3a1d29fca795e.tar.gz
rust-5bcb76181a3b0df2df5ade348af3a1d29fca795e.zip
auto merge of #13350 : huonw/rust/devec-collections, r=alexcrichton
collections: replace all ~[T] with Vec<T>.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/macros.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index fbb48f2ebcb..9d06e38dd8e 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -117,13 +117,15 @@ macro_rules! assert(
 #[macro_export]
 macro_rules! assert_eq(
     ($given:expr , $expected:expr) => ({
-        let given_val = &($given);
-        let expected_val = &($expected);
-        // check both directions of equality....
-        if !((*given_val == *expected_val) &&
-             (*expected_val == *given_val)) {
-            fail!("assertion failed: `(left == right) && (right == left)` \
-                   (left: `{}`, right: `{}`)", *given_val, *expected_val)
+        match (&($given), &($expected)) {
+            (given_val, expected_val) => {
+                // check both directions of equality....
+                if !((*given_val == *expected_val) &&
+                     (*expected_val == *given_val)) {
+                    fail!("assertion failed: `(left == right) && (right == left)` \
+                           (left: `{}`, right: `{}`)", *given_val, *expected_val)
+                }
+            }
         }
     })
 )