]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lint/unused_braces_borrow.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / lint / unused_braces_borrow.rs
1 // check-pass
2 #![warn(unused_braces)]
3
4 // changing `&{ expr }` to `&expr` changes the semantic of the program
5 // so we should not warn this case
6
7 #[repr(packed)]
8 struct A {
9 a: u8,
10 b: u32,
11 }
12
13 fn consume<T>(_: T) {}
14
15 fn main() {
16 let a = A {
17 a: 42,
18 b: 1729,
19 };
20
21 consume(&{ a.b });
22 consume({ a.b });
23 //~^ WARN unnecessary braces
24 }