Skip to content

Commit

Permalink
auto merge of #17409 : farcaller/rust/patch-1, r=huonw
Browse files Browse the repository at this point in the history
Parser.parse_method now has a second argument, I assume ast::Inherited is the correct visibility in this case.
  • Loading branch information
bors committed Sep 22, 2014
2 parents 3907a13 + 890b060 commit c14ce0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libsyntax/ext/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,12 @@ pub fn expand_quote_method(cx: &mut ExtCtxt,
tts: &[ast::TokenTree])
-> Box<base::MacResult+'static> {
let e_param_colons = cx.expr_none(sp);
let e_visibility = cx.expr_path(cx.path(sp, vec!(
id_ext("syntax"),
id_ext("ast"),
id_ext("Inherited"))));
let expanded = expand_parse_call(cx, sp, "parse_method",
vec!(e_param_colons), tts);
vec!(e_param_colons, e_visibility), tts);
base::MacExpr::new(expanded)
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass-fulldeps/quote-tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ fn syntax_extension(cx: &ExtCtxt) {

let i: Option<P<syntax::ast::Item>> = quote_item!(cx, #[deriving(Eq)] struct Foo; );
assert!(i.is_some());

let _j: P<syntax::ast::Method> = quote_method!(cx, fn foo(&self) {});
}

fn main() {
Expand Down

0 comments on commit c14ce0a

Please sign in to comment.