Skip to content

Commit

Permalink
Rollup merge of #83015 - hyd-dev:test-79825-81555, r=Aaron1011
Browse files Browse the repository at this point in the history
Add regression tests for #79825 and #81555

Closes #79825.
Closes #81555.

`@rustbot` label A-proc-macros T-compiler
  • Loading branch information
Dylan-DPC authored Apr 1, 2021
2 parents 4fdac23 + c8b2c86 commit 9e30e57
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/ui/proc-macro/auxiliary/issue-79825.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]

extern crate proc_macro;

use proc_macro::TokenStream;

#[proc_macro_attribute]
pub fn assert_input(args: TokenStream, input: TokenStream) -> TokenStream {
assert_eq!(input.to_string(), "trait Alias = Sized ;");
assert!(args.is_empty());
TokenStream::new()
}
10 changes: 10 additions & 0 deletions src/test/ui/proc-macro/issue-79825.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// check-pass
// aux-build:issue-79825.rs
#![feature(trait_alias)]

extern crate issue_79825;

#[issue_79825::assert_input]
trait Alias = Sized;

fn main() {}
15 changes: 15 additions & 0 deletions src/test/ui/proc-macro/issue-81555.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// check-pass
// aux-build:test-macros.rs
#![feature(stmt_expr_attributes, proc_macro_hygiene)]

extern crate test_macros;

use test_macros::identity_attr;

#[identity_attr]
fn main() {
let _x;
let y = ();
#[identity_attr]
_x = y;
}

0 comments on commit 9e30e57

Please sign in to comment.