]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc_macro.rs
Fix `unnecessary_cast` suggestion when taking a reference
[rust.git] / tests / ui / proc_macro.rs
1 //! Check that we correctly lint procedural macros.
2 #![crate_type = "proc-macro"]
3
4 extern crate proc_macro;
5
6 use proc_macro::TokenStream;
7
8 #[allow(dead_code)]
9 fn f() {
10     let _x = 3.14;
11 }
12
13 #[proc_macro]
14 pub fn mybangmacro(t: TokenStream) -> TokenStream {
15     t
16 }
17
18 #[proc_macro_derive(MyDerivedTrait)]
19 pub fn myderive(t: TokenStream) -> TokenStream {
20     t
21 }
22
23 #[proc_macro_attribute]
24 pub fn myattribute(t: TokenStream, a: TokenStream) -> TokenStream {
25     t
26 }