Skip to content

Commit dc89363

Browse files
lifthrasiiralexcrichton
authored andcommitted
---
yaml --- r: 110547 b: refs/heads/master c: 7a28171 h: refs/heads/master i: 110545: a302940 110543: e09888b v: v3
1 parent e5c54c8 commit dc89363

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 87334fb05ff2a665419241d877c13d6c4770a3f4
2+
refs/heads/master: 7a281718f0d32ea678f031252c0e130035fc2a80
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: e263ef1df7b892ed29e53313565eb05ab75e52f4
55
refs/heads/try: 597a645456b55e1c886ce15d23a192abdf4d55cf

trunk/src/libstd/macros.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ macro_rules! vec(
273273
let mut _temp = ::std::vec::Vec::new();
274274
$(_temp.push($e);)*
275275
_temp
276-
})
276+
});
277+
($($e:expr),+,) => (vec!($($e),+))
277278
)
278279

279280

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn main() {
12+
vec!(,); //~ ERROR unexpected token
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
pub fn main() {
13+
assert_eq!(vec!(1), vec!(1,));
14+
assert_eq!(vec!(1, 2, 3), vec!(1, 2, 3,));
15+
}

0 commit comments

Comments
 (0)