mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
27 lines
460 B
Rust
27 lines
460 B
Rust
//! Check that we correctly lint procedural macros.
|
|
#![crate_type = "proc-macro"]
|
|
|
|
extern crate proc_macro;
|
|
|
|
use proc_macro::TokenStream;
|
|
|
|
#[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
|
|
}
|