2021-08-14 19:40:06 -05:00
|
|
|
// run-pass
|
|
|
|
// edition:2021
|
|
|
|
|
|
|
|
struct Props {
|
2022-06-09 22:14:24 -05:00
|
|
|
field_1: u32, //~ WARNING: fields `field_1` and `field_2` are never read
|
|
|
|
field_2: u32,
|
2021-08-14 19:40:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// Test 1
|
2022-06-09 22:14:24 -05:00
|
|
|
let props_2 = Props { field_1: 1, field_2: 1 };
|
2021-08-14 19:40:06 -05:00
|
|
|
|
|
|
|
let _ = || {
|
|
|
|
let _: Props = props_2;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Test 2
|
|
|
|
let mut arr = [1, 3, 4, 5];
|
|
|
|
|
|
|
|
let mref = &mut arr;
|
|
|
|
|
|
|
|
let _c = || match arr {
|
2022-06-09 22:14:24 -05:00
|
|
|
[_, _, _, _] => println!("A"),
|
2021-08-14 19:40:06 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
println!("{:#?}", mref);
|
|
|
|
}
|