Skip to content

Commit

Permalink
Add regression test for #60674.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidtwco committed May 9, 2019
1 parent 9f83961 commit e57c7b8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/ui/async-await/auxiliary/issue-60674.rs
@@ -0,0 +1,12 @@
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]

extern crate proc_macro;
use proc_macro::TokenStream;

#[proc_macro_attribute]
pub fn attr(_args: TokenStream, input: TokenStream) -> TokenStream {
println!("{}", input);
TokenStream::new()
}
14 changes: 14 additions & 0 deletions src/test/ui/async-await/issue-60674.rs
@@ -0,0 +1,14 @@
// aux-build:issue-60674.rs
// compile-pass
// edition:2018
#![feature(async_await)]

// This is a regression test that ensures that `mut` patterns are not lost when provided as input
// to a proc macro.

extern crate issue_60674;

#[issue_60674::attr]
async fn f(mut x: u8) {}

fn main() {}
1 change: 1 addition & 0 deletions src/test/ui/async-await/issue-60674.stdout
@@ -0,0 +1 @@
async fn f(x: u8) { }

0 comments on commit e57c7b8

Please sign in to comment.