Skip to content

Commit 12130ad

Browse files
poiruthestinger
authored andcommitted
---
yaml --- r: 64689 b: refs/heads/snap-stage3 c: 5afb3d2 h: refs/heads/master i: 64687: 5b186cc v: v3
1 parent e46fc47 commit 12130ad

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 6c88e46d4d569b4fa0dfa995defecbe5cde62650
4+
refs/heads/snap-stage3: 5afb3d20aa30deb522401cdeef7656539e767fc2
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl<'self> CheckLoanCtxt<'self> {
232232
self.bccx.span_err(
233233
new_loan.span,
234234
fmt!("cannot borrow `%s` as %s because \
235-
it is also borrowed as %s"
235+
it is also borrowed as %s",
236236
self.bccx.loan_path_to_str(new_loan.loan_path),
237237
self.bccx.mut_to_str(new_loan.mutbl),
238238
self.bccx.mut_to_str(old_loan.mutbl)));
@@ -320,7 +320,7 @@ impl<'self> CheckLoanCtxt<'self> {
320320
// Otherwise, just a plain error.
321321
self.bccx.span_err(
322322
expr.span,
323-
fmt!("cannot assign to %s %s"
323+
fmt!("cannot assign to %s %s",
324324
cmt.mutbl.to_user_str(),
325325
self.bccx.cmt_to_str(cmt)));
326326
return;

branches/snap-stage3/src/libsyntax/ext/base.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,16 @@ pub fn get_single_str_from_tts(cx: @ExtCtxt,
357357
}
358358
}
359359

360-
pub fn get_exprs_from_tts(cx: @ExtCtxt, tts: &[ast::token_tree])
361-
-> ~[@ast::expr] {
360+
pub fn get_exprs_from_tts(cx: @ExtCtxt,
361+
sp: span,
362+
tts: &[ast::token_tree]) -> ~[@ast::expr] {
362363
let p = parse::new_parser_from_tts(cx.parse_sess(),
363364
cx.cfg(),
364365
tts.to_owned());
365366
let mut es = ~[];
366367
while *p.token != token::EOF {
367-
if es.len() != 0 {
368-
p.eat(&token::COMMA);
368+
if es.len() != 0 && !p.eat(&token::COMMA) {
369+
cx.span_fatal(sp, "expected token: `,`");
369370
}
370371
es.push(p.parse_expr());
371372
}

branches/snap-stage3/src/libsyntax/ext/bytes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use ext::build::AstBuilder;
1818

1919
pub fn expand_syntax_ext(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree]) -> base::MacResult {
2020
// Gather all argument expressions
21-
let exprs = get_exprs_from_tts(cx, tts);
21+
let exprs = get_exprs_from_tts(cx, sp, tts);
2222
let mut bytes = ~[];
2323

2424
for exprs.iter().advance |expr| {

branches/snap-stage3/src/libsyntax/ext/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use parse::token::{str_to_ident};
2626

2727
pub fn expand_syntax_ext(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
2828
-> base::MacResult {
29-
let args = get_exprs_from_tts(cx, tts);
29+
let args = get_exprs_from_tts(cx, sp, tts);
3030
if args.len() == 0 {
3131
cx.span_fatal(sp, "fmt! takes at least 1 argument.");
3232
}

0 commit comments

Comments
 (0)