1
Fork 0
rust/src/test/ui/lint/must_use-tuple.rs

16 lines
419 B
Rust
Raw Normal View History

2019-05-23 22:56:31 +01:00
#![deny(unused_must_use)]
2019-05-27 20:38:13 +01:00
fn foo() -> Result<(), ()> {
Ok::<(), ()>(())
}
2019-05-23 22:56:31 +01:00
fn main() {
(Ok::<(), ()>(()),); //~ ERROR unused `std::result::Result` that must be used
(Ok::<(), ()>(()), 0, Ok::<(), ()>(()), 5);
//~^ ERROR unused `std::result::Result` that must be used
//~^^ ERROR unused `std::result::Result` that must be used
2019-05-27 20:38:13 +01:00
foo(); //~ ERROR unused `std::result::Result` that must be used
2019-05-23 22:56:31 +01:00
}