]> git.lizzy.rs Git - rust.git/commitdiff
self arg macro test case
authorJohn Clements <clements@racket-lang.org>
Mon, 7 Jul 2014 16:53:41 +0000 (09:53 -0700)
committerJohn Clements <clements@racket-lang.org>
Tue, 8 Jul 2014 22:15:46 +0000 (15:15 -0700)
src/libsyntax/ext/expand.rs

index 764e60364e1223e49776512be42a4eeb92beb577..69e629bb3c625142675e9f7a776449ff196738d9 100644 (file)
@@ -1403,6 +1403,19 @@ macro_rules! inject_self (()=>(self))
             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(){