2
0
Fork 0
mirror of https://github.com/rust-lang/rust-clippy synced 2024-12-21 02:23:19 +00:00
rust-clippy/tests/ui/proc_macro.rs

27 lines
460 B
Rust
Raw Normal View History

2019-02-24 14:59:58 +00:00
//! Check that we correctly lint procedural macros.
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::TokenStream;
2019-02-24 14:59:58 +00:00
#[allow(dead_code)]
fn f() {
let _x = 3.14;
}
#[proc_macro]
pub fn mybangmacro(t: TokenStream) -> TokenStream {
t
}
#[proc_macro_derive(MyDerivedTrait)]
pub fn myderive(t: TokenStream) -> TokenStream {
t
}
#[proc_macro_attribute]
pub fn myattribute(t: TokenStream, a: TokenStream) -> TokenStream {
t
}