rust/tests/ui/lint/warn-path-statement.rs

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

18 lines
316 B
Rust
Raw Normal View History

//@ compile-flags: -D path-statements
struct Droppy;
impl Drop for Droppy {
fn drop(&mut self) {}
}
fn main() {
2015-02-01 00:23:42 +08:00
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
}