Merge pull request #3260 from topecongiro/issue-3004

Do not modify original source code inside macro call
This commit is contained in:
Nick Cameron 2019-01-07 17:39:05 +13:00 committed by GitHub
commit 2c204c11d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View file

@ -466,3 +466,8 @@ static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
RefCell::new(RootedTraceableSet::new(1234)) ;
] ;
fn issue3004() {
foo!(|_| { ( ) });
stringify!(( foo+ ));
}

View file

@ -1043,3 +1043,8 @@ thread_local![
static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
RefCell::new(RootedTraceableSet::new(1234));
];
fn issue3004() {
foo!(|_| { () });
stringify!((foo+));
}