Closed
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.