6/29/2026 at 11:39:32 AM
This would have been flagged by Clippy lints `let_underscore_untyped` or `let_underscore_must_use`, which sadly are not enabled by default.by Twey
6/29/2026 at 1:10:53 PM
Or just by not writing let _ =by microgpt
6/29/2026 at 1:31:11 PM
All recurrent people problems are system problems.by Twey
6/29/2026 at 2:32:41 PM
As seen by the fact that forcing the programmer to write let _ = to silence the warning did not fix the bug.You know what might've solved this though? Using threads instead of async
by microgpt
6/29/2026 at 12:09:22 PM
Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)]
let _ = self.poll_flush(cx)?;
by pwdisswordfishq
6/29/2026 at 12:36:57 PM
I said ‘flagged’, not ‘fixed’ :)You can always write the wrong code if you want it enough. But hopefully a warning would have prompted someone to think harder about this flow.
by Twey
6/29/2026 at 1:02:11 PM
But "let _ =" is already an explicit suppression of a must-use warning. Where does this arms race of "no, I really know what I am doing, compiler" versus "no, this really looks like a mistake, programmer" end?by pwdisswordfishq
6/29/2026 at 1:28:21 PM
That's an excellent question I don't have an answer for in general :)IMHO the goal is usually for the compiler not to make these decisions but to provide the tools for the APIs people build to make them. That's kind of passing the buck, though.
I guess in this case the core problem is that the API for these I/O calls has no representation in the type system for what's happening to the buffer. Proxying it as ‘the programmer must think about this code path’ is a reasonable best-effort but, evidently, sometimes inadequate.
by Twey
6/29/2026 at 2:00:25 PM
I do feel like Rust did enough to allow software engineers and their managers to make an explicit choice here.by tialaramex
6/29/2026 at 2:01:10 PM
And this is why you should warn on `clippy::allow_attributes_without_reason` in your projects.by PoignardAzur
6/29/2026 at 12:20:39 PM
You can set the lints to `forbid` instead of `deny`, which means they can't be `allowed` like that.by lunar_mycroft
6/29/2026 at 12:17:09 PM
Yeah, but you must know about them and the possible bug first in order to allow them...by nesarkvechnep
6/29/2026 at 12:39:02 PM
Hence ‘sadly’. IMNSHO both of these (or at least _untyped) should be enabled by default. Untyped `let _` is too big a footgun during refactorings.by Twey
6/29/2026 at 12:25:07 PM
At which point you wouldn't have written this bug in the first place; or the warnings would trigger immediately, you'd change _ to an actual variable and then remove the warning pragmas because now you don't assign to _.by Joker_vD
6/29/2026 at 12:40:47 PM
`Poll` is marked `#[must_use]` so if you were assigning to something other than `_` you'd get a warning that you're ignoring the `Pending` path. The Clippy lint is only for `_` which Rust considers a use by default.by Twey
6/29/2026 at 2:22:22 PM
Not really. If I'm using a linter, I go and configure the strictest possible ruleset, and only disable rules when justified on a need-by-need basis. It's just a matter of discipline.by turboponyy
6/29/2026 at 1:52:10 PM
[flagged]by jimmypk