fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// check-pass 2// run-rustfix 3 4#![warn(unused_braces)] 5 6// changing `&{ expr }` to `&expr` changes the semantic of the program 7// so we should not warn this case 8 9#[repr(packed)] 10pub struct A { 11 pub a: u8, 12 pub b: u32, 13} 14 15fn consume<T>(_: T) {} 16 17fn main() { 18 let a = A { 19 a: 42, 20 b: 1729, 21 }; 22 23 consume(&{ a.b }); 24 consume(a.b); 25 //~^ WARN unnecessary braces 26}