-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #13241 - alex-semenyuk:fix_double_must_use, r=xFrednet
Fix confusing message in double_must_use lint Close #13003 As mentioned at #13003 it isn't quite clear what it means "an empty `#[must_use]` attribute" so clarify it changelog: [none]
- Loading branch information
Showing
3 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
error: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]` | ||
error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` | ||
--> tests/ui/double_must_use.rs:5:1 | ||
| | ||
LL | pub fn must_use_result() -> Result<(), ()> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: either add some descriptive text or remove the attribute | ||
= help: either add some descriptive message or remove the attribute | ||
= note: `-D clippy::double-must-use` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::double_must_use)]` | ||
|
||
error: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]` | ||
error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` | ||
--> tests/ui/double_must_use.rs:11:1 | ||
| | ||
LL | pub fn must_use_tuple() -> (Result<(), ()>, u8) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: either add some descriptive text or remove the attribute | ||
= help: either add some descriptive message or remove the attribute | ||
|
||
error: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]` | ||
error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` | ||
--> tests/ui/double_must_use.rs:17:1 | ||
| | ||
LL | pub fn must_use_array() -> [Result<(), ()>; 1] { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: either add some descriptive text or remove the attribute | ||
= help: either add some descriptive message or remove the attribute | ||
|
||
error: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]` | ||
error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` | ||
--> tests/ui/double_must_use.rs:34:1 | ||
| | ||
LL | async fn async_must_use_result() -> Result<(), ()> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: either add some descriptive text or remove the attribute | ||
= help: either add some descriptive message or remove the attribute | ||
|
||
error: aborting due to 4 previous errors | ||
|