mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Rollup merge of #83015 - hyd-dev:test-79825-81555, r=Aaron1011
Add regression tests for #79825 and #81555 Closes #79825. Closes #81555. `@rustbot` label A-proc-macros T-compiler
This commit is contained in:
commit
9e30e57eeb
14
src/test/ui/proc-macro/auxiliary/issue-79825.rs
Normal file
14
src/test/ui/proc-macro/auxiliary/issue-79825.rs
Normal file
@ -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
src/test/ui/proc-macro/issue-79825.rs
Normal file
10
src/test/ui/proc-macro/issue-79825.rs
Normal file
@ -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
src/test/ui/proc-macro/issue-81555.rs
Normal file
15
src/test/ui/proc-macro/issue-81555.rs
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user