You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was decided #[must_use] should act just as on any function in this case: #54828. The "explicit return syntax" is semantically no different from the implicit return type and making that different would be misleading.
This code:
Gives (rustc 1.31.0-nightly 2c2e2c5 2018-10-12):
But what I expected is no warning on the foo call, and an error (or warning) for adding #[must_use] on a function without return value.
In (rare) code like this, where the unit (empty tuple) is returned in an explicit way, I expect no errors nor warnings:
The text was updated successfully, but these errors were encountered: