mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
18 lines
305 B
Rust
18 lines
305 B
Rust
|
// run-pass
|
||
|
|
||
|
#![allow(dead_code)]
|
||
|
|
||
|
struct Foo {
|
||
|
foo: i32,
|
||
|
bar: i32,
|
||
|
baz: (),
|
||
|
}
|
||
|
|
||
|
fn use_foo(x: Foo) -> (i32, i32) {
|
||
|
let Foo { foo, bar, baz } = x; //~ WARNING unused variable: `baz`
|
||
|
//~| help: try ignoring the field
|
||
|
return (foo, bar);
|
||
|
}
|
||
|
|
||
|
fn main() {}
|