]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | // aux-build:macro_rules.rs |
2 | ||
3 | #![warn(clippy::toplevel_ref_arg)] | |
4 | #![allow(unused)] | |
5 | ||
6 | #[macro_use] | |
7 | extern crate macro_rules; | |
8 | ||
9 | fn the_answer(ref mut x: u8) { | |
10 | *x = 42; | |
11 | } | |
12 | ||
13 | macro_rules! gen_function { | |
14 | () => { | |
15 | fn fun_example(ref _x: usize) {} | |
16 | }; | |
17 | } | |
18 | ||
19 | fn main() { | |
20 | let mut x = 0; | |
21 | the_answer(x); | |
22 | ||
23 | // lint in macro | |
24 | #[allow(unused)] | |
25 | { | |
26 | gen_function!(); | |
27 | } | |
28 | ||
29 | // do not lint in external macro | |
30 | { | |
31 | ref_arg_function!(); | |
32 | } | |
33 | } |