Skip to content

Commit 21e580f

Browse files
committed
fix two distinct builds issues (one noted by try, another caught during local build).
1 parent ac56d7f commit 21e580f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/libsyntax/ext/format.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use codemap::{Span, respan};
1616
use ext::base::*;
1717
use ext::base;
1818
use ext::build::AstBuilder;
19-
use fold::Folder;
2019
use fmt_macros as parse;
2120
use parse::token::special_idents;
2221
use parse::token;
@@ -635,6 +634,7 @@ pub fn ensure_not_fmt_string_literal<'cx>(cx: &'cx mut ExtCtxt,
635634
sp: Span,
636635
tts: &[ast::TokenTree])
637636
-> Box<base::MacResult+'cx> {
637+
use fold::Folder;
638638
let takes_two_args = |cx: &ExtCtxt, rest| {
639639
cx.span_err(sp, &format!("`ensure_not_fmt_string_literal!` \
640640
takes 2 arguments, {}", rest));
@@ -643,9 +643,8 @@ pub fn ensure_not_fmt_string_literal<'cx>(cx: &'cx mut ExtCtxt,
643643
let mut p = cx.new_parser_from_tts(tts);
644644
if p.token == token::Eof { return takes_two_args(cx, "given 0"); }
645645
let arg1 = cx.expander().fold_expr(p.parse_expr());
646-
if p.token != token::Comma { return takes_two_args(cx, "comma-separated"); }
647-
p.bump();
648646
if p.token == token::Eof { return takes_two_args(cx, "given 1"); }
647+
if !p.eat(&token::Comma) { return takes_two_args(cx, "comma-separated"); }
649648
let arg2 = cx.expander().fold_expr(p.parse_expr());
650649
if p.token != token::Eof {
651650
takes_two_args(cx, "given too many");

0 commit comments

Comments
 (0)