]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui-toml/toml_trivially_copy/test.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui-toml / toml_trivially_copy / test.rs
1 // normalize-stderr-test "\(\d+ byte\)" -> "(N byte)"
2 // normalize-stderr-test "\(limit: \d+ byte\)" -> "(limit: N byte)"
3
4 #![deny(clippy::trivially_copy_pass_by_ref)]
5 #![allow(clippy::many_single_char_names)]
6
7 #[derive(Copy, Clone)]
8 struct Foo(u8);
9
10 #[derive(Copy, Clone)]
11 struct Bar(u32);
12
13 fn good(a: &mut u32, b: u32, c: &Bar, d: &u32) {}
14
15 fn bad(x: &u16, y: &Foo) {}
16
17 fn main() {
18 let (mut a, b, c, d, x, y) = (0, 0, Bar(0), 0, 0, Foo(0));
19 good(&mut a, b, &c, &d);
20 bad(&x, &y);
21 }