Skip to content

Commit de2bf3a

Browse files
committed
Add nested must_use variant
1 parent 81fa794 commit de2bf3a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/test/ui/lint/must_use-tuple.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ fn main() {
1212
//~^^ ERROR unused `std::result::Result`
1313

1414
foo(); //~ ERROR unused `std::result::Result`
15+
16+
((Err::<(), ()>(()), ()), ()); //~ ERROR unused `std::result::Result`
1517
}

src/test/ui/lint/must_use-tuple.stderr

+9-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,13 @@ LL | foo();
3535
|
3636
= note: this `Result` may be an `Err` variant, which should be handled
3737

38-
error: aborting due to 4 previous errors
38+
error: unused `std::result::Result` in tuple element 0 that must be used
39+
--> $DIR/must_use-tuple.rs:16:6
40+
|
41+
LL | ((Err::<(), ()>(()), ()), ());
42+
| ^^^^^^^^^^^^^^^^^^^^^^^
43+
|
44+
= note: this `Result` may be an `Err` variant, which should be handled
45+
46+
error: aborting due to 5 previous errors
3947

0 commit comments

Comments
 (0)