Skip to content

Commit c14ce0a

Browse files
committed
auto merge of #17409 : farcaller/rust/patch-1, r=huonw
Parser.parse_method now has a second argument, I assume ast::Inherited is the correct visibility in this case.
2 parents 3907a13 + 890b060 commit c14ce0a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/libsyntax/ext/quote.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,12 @@ pub fn expand_quote_method(cx: &mut ExtCtxt,
465465
tts: &[ast::TokenTree])
466466
-> Box<base::MacResult+'static> {
467467
let e_param_colons = cx.expr_none(sp);
468+
let e_visibility = cx.expr_path(cx.path(sp, vec!(
469+
id_ext("syntax"),
470+
id_ext("ast"),
471+
id_ext("Inherited"))));
468472
let expanded = expand_parse_call(cx, sp, "parse_method",
469-
vec!(e_param_colons), tts);
473+
vec!(e_param_colons, e_visibility), tts);
470474
base::MacExpr::new(expanded)
471475
}
472476

src/test/run-pass-fulldeps/quote-tokens.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ fn syntax_extension(cx: &ExtCtxt) {
3535

3636
let i: Option<P<syntax::ast::Item>> = quote_item!(cx, #[deriving(Eq)] struct Foo; );
3737
assert!(i.is_some());
38+
39+
let _j: P<syntax::ast::Method> = quote_method!(cx, fn foo(&self) {});
3840
}
3941

4042
fn main() {

0 commit comments

Comments
 (0)