-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
There are at least two problems with #[must_use]:
- it doesn't work on type aliases at all.
- for methods that return a type containing a
#[must_use]type, no warning is issued if the#[must_use]value is immediately discarded by destructuring assignment at the caller.
Edit: the consensus is that #[must_use] should not be usable on type aliases, but it should not just silently fail. The behaviour with destructing assignment is intentional.
kornelski, najamelan, BatmanAoD and sugar700
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.