rust/tests/ui/lint/unused/must_use-tuple.rs

18 lines
369 B
Rust
Raw Normal View History

2019-05-23 16:56:31 -05:00
#![deny(unused_must_use)]
2019-05-28 14:12:48 -05:00
fn foo() -> (Result<(), ()>, ()) {
(Ok::<(), ()>(()), ())
2019-05-27 14:38:13 -05:00
}
2019-05-23 16:56:31 -05:00
fn main() {
2021-01-28 10:01:36 -06:00
(Ok::<(), ()>(()),); //~ ERROR unused `Result`
(Ok::<(), ()>(()), 0, Ok::<(), ()>(()), 5);
2021-01-28 10:01:36 -06:00
//~^ ERROR unused `Result`
//~^^ ERROR unused `Result`
2019-05-27 14:38:13 -05:00
2021-01-28 10:01:36 -06:00
foo(); //~ ERROR unused `Result`
2019-06-03 12:50:32 -05:00
2021-01-28 10:01:36 -06:00
((Err::<(), ()>(()), ()), ()); //~ ERROR unused `Result`
2019-05-23 16:56:31 -05:00
}