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

16 lines
419 B
Rust
Raw Normal View History

2019-05-23 21:56:31 +00:00
#![deny(unused_must_use)]
2019-05-27 19:38:13 +00:00
fn foo() -> Result<(), ()> {
Ok::<(), ()>(())
}
2019-05-23 21:56:31 +00: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 19:38:13 +00:00
foo(); //~ ERROR unused `std::result::Result` that must be used
2019-05-23 21:56:31 +00:00
}