]>
Commit | Line | Data |
---|---|---|
781aab86 | 1 | //@aux-build:proc_macros.rs |
f20569fa XL |
2 | |
3 | #![warn(clippy::toplevel_ref_arg)] | |
4 | #![allow(unused)] | |
5 | ||
353b0b11 FG |
6 | extern crate proc_macros; |
7 | use proc_macros::{external, inline_macros}; | |
f20569fa XL |
8 | |
9 | fn the_answer(ref mut x: u8) { | |
10 | *x = 42; | |
11 | } | |
12 | ||
353b0b11 | 13 | #[inline_macros] |
f20569fa XL |
14 | fn main() { |
15 | let mut x = 0; | |
16 | the_answer(x); | |
17 | ||
18 | // lint in macro | |
353b0b11 FG |
19 | inline! { |
20 | fn fun_example(ref _x: usize) {} | |
f20569fa XL |
21 | } |
22 | ||
23 | // do not lint in external macro | |
353b0b11 FG |
24 | external! { |
25 | fn fun_example2(ref _x: usize) {} | |
f20569fa XL |
26 | } |
27 | } |