Skip to content

Commit 9ba95f8

Browse files
committed
---
yaml --- r: 118962 b: refs/heads/master c: 05ca9f7 h: refs/heads/master v: v3
1 parent 72d3d26 commit 9ba95f8

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
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: 7e694e71153ebc8d3f2be9c20783bb283e38a59e
2+
refs/heads/master: 05ca9f747d62c9385cc142daa3c24a32d32a3f16
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 71fe44def9676d519f5ce5d7304e581a42cf2c70
55
refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f

trunk/src/libsyntax/ext/base.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,14 @@ pub fn get_exprs_from_tts(cx: &mut ExtCtxt,
593593
.collect());
594594
let mut es = Vec::new();
595595
while p.token != token::EOF {
596-
if es.len() != 0 && !p.eat(&token::COMMA) {
596+
es.push(cx.expand_expr(p.parse_expr()));
597+
if p.eat(&token::COMMA) {
598+
continue;
599+
}
600+
if p.token != token::EOF {
597601
cx.span_err(sp, "expected token: `,`");
598602
return None;
599603
}
600-
es.push(cx.expand_expr(p.parse_expr()));
601604
}
602605
Some(es)
603606
}

trunk/src/test/run-make/tools.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# These deliberately use `=` and not `:=` so that client makefiles can
22
# augment HOST_RPATH_DIR / TARGET_RPATH_DIR.
33
HOST_RPATH_ENV = \
4-
$(LD_LIB_PATH_ENVVAR)="$(HOST_RPATH_DIR):$($(LD_LIB_PATH_ENVVAR))"
4+
$(LD_LIB_PATH_ENVVAR)="$(TMPDIR):$(HOST_RPATH_DIR):$($(LD_LIB_PATH_ENVVAR))"
55
TARGET_RPATH_ENV = \
6-
$(LD_LIB_PATH_ENVVAR)="$(TARGET_RPATH_DIR):$($(LD_LIB_PATH_ENVVAR))"
6+
$(LD_LIB_PATH_ENVVAR)="$(TMPDIR):$(TARGET_RPATH_DIR):$($(LD_LIB_PATH_ENVVAR))"
77

88
RUSTC := $(HOST_RPATH_ENV) $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
99
CC := $(CC) -L $(TMPDIR)

trunk/src/test/run-pass/concat.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -11,6 +11,8 @@
1111
pub fn main() {
1212
assert_eq!(format!(concat!("foo", "bar", "{}"), "baz"), "foobarbaz".to_string());
1313
assert_eq!(format!(concat!()), "".to_string());
14+
// check trailing comma is allowed in concat
15+
assert_eq!(concat!("qux", "quux",).to_string(), "quxquux".to_string());
1416

1517
assert_eq!(
1618
concat!(1, 2i, 3u, 4f32, 4.0, 'a', true, ()),

0 commit comments

Comments
 (0)