rust/src/test/ui/suggestions/try-removing-the-field.rs

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

18 lines
288 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
struct Foo {
foo: i32,
bar: (),
baz: (),
}
fn use_foo(x: Foo) -> i32 {
let Foo { foo, bar, .. } = x; //~ WARNING unused variable: `bar`
//~| help: try removing the field
return foo;
}
fn main() {}