summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/warn-path-statement.rs
blob: 2435be623f310312c7fbdac55161fc0f1454dd6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// compile-flags: -D path-statements
struct Droppy;

impl Drop for Droppy {
    fn drop(&mut self) {}
}

fn main() {
    let x = 10;
    x; //~ ERROR path statement with no effect

    let y = Droppy;
    y; //~ ERROR path statement drops value

    let z = (Droppy,);
    z; //~ ERROR path statement drops value
}