File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1390,6 +1390,19 @@ mod test {
1390
1390
// but *shouldn't* bind because it was inserted by a different macro....
1391
1391
// can't write this test case until we have macro-generating macros.
1392
1392
1393
+ // method arg hygiene
1394
+ // method expands to fn get_x(&self_0, x_1:int) {self_0 + self_2 + x_3 + x_1}
1395
+ #[ test] fn method_arg_hygiene ( ) {
1396
+ run_renaming_test (
1397
+ & ( "macro_rules! inject_x (()=>(x))
1398
+ macro_rules! inject_self (()=>(self))
1399
+ struct A;
1400
+ impl A{fn get_x(&self, x: int) {self + inject_self!() + inject_x!() + x;} }" ,
1401
+ vec ! ( vec!( 0 ) , vec!( 3 ) ) ,
1402
+ true ) ,
1403
+ 0 )
1404
+ }
1405
+
1393
1406
// item fn hygiene
1394
1407
// expands to fn q(x_1:int){fn g(x_2:int){x_2 + x_1};}
1395
1408
#[ test] fn issue_9383 ( ) {
You can’t perform that action at this time.
0 commit comments