Skip to content
Permalink
Browse files

Add function call to test

  • Loading branch information...
varkor committed May 27, 2019
1 parent 3c768ad commit 058551c4fdb067a642e096e7c50ea82e3fd09e7c
Showing with 18 additions and 4 deletions.
  1. +6 −0 src/test/ui/lint/must_use-tuple.rs
  2. +12 −4 src/test/ui/lint/must_use-tuple.stderr
@@ -1,9 +1,15 @@
#![deny(unused_must_use)]

fn foo() -> Result<(), ()> {
Ok::<(), ()>(())
}

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

foo(); //~ ERROR unused `std::result::Result` that must be used
}
@@ -1,5 +1,5 @@
error: unused `std::result::Result` that must be used
--> $DIR/must_use-tuple.rs:4:6
--> $DIR/must_use-tuple.rs:8:6
|
LL | (Ok::<(), ()>(()),);
| ^^^^^^^^^^^^^^^^
@@ -12,20 +12,28 @@ LL | #![deny(unused_must_use)]
= note: this `Result` may be an `Err` variant, which should be handled

error: unused `std::result::Result` that must be used
--> $DIR/must_use-tuple.rs:6:6
--> $DIR/must_use-tuple.rs:10:6
|
LL | (Ok::<(), ()>(()), 0, Ok::<(), ()>(()), 5);
| ^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled

error: unused `std::result::Result` that must be used
--> $DIR/must_use-tuple.rs:6:27
--> $DIR/must_use-tuple.rs:10:27
|
LL | (Ok::<(), ()>(()), 0, Ok::<(), ()>(()), 5);
| ^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled

error: aborting due to 3 previous errors
error: unused `std::result::Result` that must be used
--> $DIR/must_use-tuple.rs:14:5
|
LL | foo();
| ^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled

error: aborting due to 4 previous errors

0 comments on commit 058551c

Please sign in to comment.
You can’t perform that action at this time.