]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / toplevel_ref_arg_non_rustfix.rs
CommitLineData
f20569fa
XL
1// aux-build:macro_rules.rs
2
3#![warn(clippy::toplevel_ref_arg)]
4#![allow(unused)]
5
6#[macro_use]
7extern crate macro_rules;
8
9fn the_answer(ref mut x: u8) {
10 *x = 42;
11}
12
13macro_rules! gen_function {
14 () => {
15 fn fun_example(ref _x: usize) {}
16 };
17}
18
19fn 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}