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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
369 B
Rust
Raw Normal View History

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