2023-04-20 09:37:15 -05:00
|
|
|
//@aux-build:macros.rs
|
2022-10-05 08:44:01 -05:00
|
|
|
|
|
|
|
#![allow(unused)]
|
|
|
|
|
|
|
|
extern crate macros;
|
|
|
|
|
|
|
|
use serde::Serialize;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("one");
|
|
|
|
println!("two");
|
|
|
|
cfg!(unix);
|
|
|
|
vec![1, 2, 3];
|
|
|
|
|
|
|
|
#[derive(Serialize)]
|
|
|
|
struct Derive;
|
|
|
|
|
|
|
|
let _ = macros::expr!();
|
|
|
|
macros::stmt!();
|
|
|
|
let macros::pat!() = 1;
|
|
|
|
let _: macros::ty!() = "";
|
|
|
|
macros::item!();
|
2023-08-31 07:52:55 -05:00
|
|
|
let _ = macros::binop!(1);
|
2022-10-05 08:44:01 -05:00
|
|
|
|
|
|
|
eprintln!("allowed");
|
|
|
|
}
|
|
|
|
|
2023-08-31 07:52:55 -05:00
|
|
|
macros::attr! {
|
|
|
|
struct S;
|
|
|
|
}
|
2022-10-05 08:44:01 -05:00
|
|
|
|
|
|
|
impl S {
|
|
|
|
macros::item!();
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Y {
|
|
|
|
macros::item!();
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Y for S {
|
|
|
|
macros::item!();
|
|
|
|
}
|