rust/src/test/ui/lint/must_use-unit.rs

18 lines
232 B
Rust
Raw Normal View History

#![feature(never_type)]
#![deny(unused_must_use)]
#[must_use]
fn foo() {}
#[must_use]
fn bar() -> ! {
unimplemented!()
}
fn main() {
foo(); //~ unused return value of `foo`
bar(); //~ unused return value of `bar`
}