diff --git a/src/test/ui/lint/must_use-tuple.rs b/src/test/ui/lint/must_use-tuple.rs index efbe0ff9c6c9..f6b579a7f35c 100644 --- a/src/test/ui/lint/must_use-tuple.rs +++ b/src/test/ui/lint/must_use-tuple.rs @@ -12,4 +12,6 @@ fn main() { //~^^ ERROR unused `std::result::Result` foo(); //~ ERROR unused `std::result::Result` + + ((Err::<(), ()>(()), ()), ()); //~ ERROR unused `std::result::Result` } diff --git a/src/test/ui/lint/must_use-tuple.stderr b/src/test/ui/lint/must_use-tuple.stderr index 4efcb8703aaa..45d2a439e52b 100644 --- a/src/test/ui/lint/must_use-tuple.stderr +++ b/src/test/ui/lint/must_use-tuple.stderr @@ -35,5 +35,13 @@ LL | foo(); | = note: this `Result` may be an `Err` variant, which should be handled -error: aborting due to 4 previous errors +error: unused `std::result::Result` in tuple element 0 that must be used + --> $DIR/must_use-tuple.rs:16:6 + | +LL | ((Err::<(), ()>(()), ()), ()); + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this `Result` may be an `Err` variant, which should be handled + +error: aborting due to 5 previous errors