Use precise span for must_use tuple components
This commit is contained in:
parent
fd36b5fd52
commit
e121d9671a
3 changed files with 38 additions and 7 deletions
|
|
@ -2,4 +2,8 @@
|
|||
|
||||
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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: unused `std::result::Result` that must be used
|
||||
--> $DIR/must_use-tuple.rs:4:5
|
||||
--> $DIR/must_use-tuple.rs:4:6
|
||||
|
|
||||
LL | (Ok::<(), ()>(()),);
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/must_use-tuple.rs:1:9
|
||||
|
|
@ -11,5 +11,21 @@ LL | #![deny(unused_must_use)]
|
|||
| ^^^^^^^^^^^^^^^
|
||||
= note: this `Result` may be an `Err` variant, which should be handled
|
||||
|
||||
error: aborting due to previous error
|
||||
error: unused `std::result::Result` that must be used
|
||||
--> $DIR/must_use-tuple.rs:6: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
|
||||
|
|
||||
LL | (Ok::<(), ()>(()), 0, Ok::<(), ()>(()), 5);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this `Result` may be an `Err` variant, which should be handled
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue