rust/tests/ui/lint/unused/must_use-tuple.rs
2023-01-11 09:32:08 +00:00

18 lines
369 B
Rust

#![deny(unused_must_use)]
fn foo() -> (Result<(), ()>, ()) {
(Ok::<(), ()>(()), ())
}
fn main() {
(Ok::<(), ()>(()),); //~ ERROR unused `Result`
(Ok::<(), ()>(()), 0, Ok::<(), ()>(()), 5);
//~^ ERROR unused `Result`
//~^^ ERROR unused `Result`
foo(); //~ ERROR unused `Result`
((Err::<(), ()>(()), ()), ()); //~ ERROR unused `Result`
}