summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <raof@ubuntu.com>2015-07-17 21:36:22 +0800
committerChristopher James Halse Rogers <raof@ubuntu.com>2015-07-17 21:36:22 +0800
commit8d92ba7692ec570a163762a1a00ad745312d98ed (patch)
tree46fde4fb9c3d8e8ceea0d4bec3b541bf975272f2
parenta80623333305ea75a3d3e6a2248e5103f69a3a53 (diff)
Use parser.check(&token::Eof) rather than .eat().
.eat() will eat a token at *any* position in the input, and there's always an EOF, so the loop that was meant to loop over all the arguments was instead always terminating after the first one. parser.check(&token::Eof) returns true iff the *next* token is EOF, which is what we want.
-rw-r--r--bindgen_plugin/src/bgmacro.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/bindgen_plugin/src/bgmacro.rs b/bindgen_plugin/src/bgmacro.rs
index 106b9451..803da751 100644
--- a/bindgen_plugin/src/bgmacro.rs
+++ b/bindgen_plugin/src/bgmacro.rs
@@ -205,7 +205,7 @@ fn parse_macro_opts(cx: &mut base::ExtCtxt, tts: &[ast::TokenTree], visit: &mut
}
}
- if parser.eat(&token::Eof).is_ok() {
+ if parser.check(&token::Eof) {
return args_good
}