From 92c2ff6d697fe7be2d4e3979b4dec9f86b969b69 Mon Sep 17 00:00:00 2001 From: John Clements Date: Mon, 7 Jul 2014 09:53:41 -0700 Subject: [PATCH] self arg macro test case --- src/libsyntax/ext/expand.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 764e60364e1..69e629bb3c6 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1403,6 +1403,19 @@ fn z() {match 8 {x => bad_macro!(x)}}", 0) } + // ooh, got another bite? + // expands to struct A; impl A {fn thingy(&self_1) {self_1;}} + #[test] fn method_arg_hygiene_2(){ + run_renaming_test( + &("struct A; + macro_rules! add_method (($T:ty) => + (impl $T { fn thingy(&self) {self;} })) + add_method!(A)", + vec!(vec!(0)), + true), + 0) + } + // item fn hygiene // expands to fn q(x_1:int){fn g(x_2:int){x_2 + x_1};} #[test] fn issue_9383(){ -- GitLab