Skip to content

Commit e57c7b8

Browse files
committed
Add regression test for rust-lang#60674.
This commit adds a regression test (with current broken behaviour) that tests that `mut` patterns are not lost when provided as input to a proc macro.
1 parent 9f83961 commit e57c7b8

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// force-host
2+
// no-prefer-dynamic
3+
#![crate_type = "proc-macro"]
4+
5+
extern crate proc_macro;
6+
use proc_macro::TokenStream;
7+
8+
#[proc_macro_attribute]
9+
pub fn attr(_args: TokenStream, input: TokenStream) -> TokenStream {
10+
println!("{}", input);
11+
TokenStream::new()
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// aux-build:issue-60674.rs
2+
// compile-pass
3+
// edition:2018
4+
#![feature(async_await)]
5+
6+
// This is a regression test that ensures that `mut` patterns are not lost when provided as input
7+
// to a proc macro.
8+
9+
extern crate issue_60674;
10+
11+
#[issue_60674::attr]
12+
async fn f(mut x: u8) {}
13+
14+
fn main() {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
async fn f(x: u8) { }

0 commit comments

Comments
 (0)