]> git.lizzy.rs Git - rust.git/blob - tests/ui-toml/toml_trivially_copy/test.rs
trivially_copy_pass_by_ref: print size of type and limit in the lint message
[rust.git] / 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 #![allow(clippy::many_single_char_names)]
5
6 #[derive(Copy, Clone)]
7 struct Foo(u8);
8
9 #[derive(Copy, Clone)]
10 struct Bar(u32);
11
12 fn good(a: &mut u32, b: u32, c: &Bar, d: &u32) {}
13
14 fn bad(x: &u16, y: &Foo) {}
15
16 fn main() {
17     let (mut a, b, c, d, x, y) = (0, 0, Bar(0), 0, 0, Foo(0));
18     good(&mut a, b, &c, &d);
19     bad(&x, &y);
20 }