summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/dont-try-removing-the-field.rs
blob: 948aa2b94d9656dffa72ed6b022038bc93743269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 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() {}