]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / toplevel_ref_arg_non_rustfix.rs
1 //@aux-build:proc_macros.rs
2
3 #![warn(clippy::toplevel_ref_arg)]
4 #![allow(unused)]
5
6 extern crate proc_macros;
7 use proc_macros::{external, inline_macros};
8
9 fn the_answer(ref mut x: u8) {
10 *x = 42;
11 }
12
13 #[inline_macros]
14 fn main() {
15 let mut x = 0;
16 the_answer(x);
17
18 // lint in macro
19 inline! {
20 fn fun_example(ref _x: usize) {}
21 }
22
23 // do not lint in external macro
24 external! {
25 fn fun_example2(ref _x: usize) {}
26 }
27 }