rust/tests/ui/suggestions/dont-try-removing-the-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
306 B
Rust
Raw Normal View History

//@ 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() {}