mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 14:24:08 +00:00
Add function call to test
This commit is contained in:
parent
3c768ade4d
commit
058551c4fd
@ -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,7 +12,7 @@ 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);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
@ -20,12 +20,20 @@ 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user