2
0
Fork 0
mirror of https://github.com/rust-lang/rust-clippy synced 2024-12-25 04:23:22 +00:00
rust-clippy/tests/ui-toml/toml_trivially_copy/test.rs

22 lines
512 B
Rust
Raw Normal View History

//@normalize-stderr-test: "\(\d+ byte\)" -> "(N byte)"
//@normalize-stderr-test: "\(limit: \d+ byte\)" -> "(limit: N byte)"
2023-07-27 11:40:22 +00:00
//@no-rustfix
2023-04-20 15:19:36 +00:00
#![warn(clippy::trivially_copy_pass_by_ref)]
#![allow(clippy::needless_pass_by_ref_mut)]
#[derive(Copy, Clone)]
struct Foo(u8);
#[derive(Copy, Clone)]
struct Bar(u32);
2018-12-09 22:26:16 +00:00
fn good(a: &mut u32, b: u32, c: &Bar, d: &u32) {}
2018-12-09 22:26:16 +00:00
fn bad(x: &u16, y: &Foo) {}
fn main() {
let (mut a, b, c, d, x, y) = (0, 0, Bar(0), 0, 0, Foo(0));
good(&mut a, b, &c, &d);
bad(&x, &y);
}