about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorKang Seonghoon <public+git@mearie.org>2014-04-03 16:40:56 +0900
committerAlex Crichton <alex@alexcrichton.com>2014-04-08 00:03:12 -0700
commit7a281718f0d32ea678f031252c0e130035fc2a80 (patch)
tree0751e90a71066c425bd96185e80fbfbf4b0a7c12 /src/libstd
parent87334fb05ff2a665419241d877c13d6c4770a3f4 (diff)
downloadrust-7a281718f0d32ea678f031252c0e130035fc2a80.tar.gz
rust-7a281718f0d32ea678f031252c0e130035fc2a80.zip
std: make vec!() macro handle a trailing comma
Fixes #12910.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/macros.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index 1a35252f8ca..fbb48f2ebcb 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -273,7 +273,8 @@ macro_rules! vec(
         let mut _temp = ::std::vec::Vec::new();
         $(_temp.push($e);)*
         _temp
-    })
+    });
+    ($($e:expr),+,) => (vec!($($e),+))
 )