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