rust-clippy/tests/ui-toml/disallowed_macros/disallowed_macros.rs

49 lines
662 B
Rust
Raw Normal View History

//@aux-build:macros.rs
//@aux-build:proc_macros.rs
2022-10-05 13:44:01 +00:00
#![allow(unused)]
extern crate macros;
extern crate proc_macros;
2022-10-05 13:44:01 +00:00
use proc_macros::Derive;
2022-10-05 13:44:01 +00:00
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!();
let _ = macros::binop!(1);
2022-10-05 13:44:01 +00:00
eprintln!("allowed");
}
macros::attr! {
struct S;
}
2022-10-05 13:44:01 +00:00
impl S {
macros::item!();
}
trait Y {
macros::item!();
}
impl Y for S {
macros::item!();
}
#[derive(Derive)]
struct Foo;