News for hackers. Stuff that matters.
Re:Weird Expressions in Rust by derriz on Friday June 27, 2025 @03:30PM (#44399565)
See my comment above, your example only "just works" if the enclosing function has the appropriate return type (in this case none).

So the syntactic element "return" is not just an expression - unlike other sub-expressions, it involves action at a distance - i.e. it must not just agree with it's context as part of an expression but it must agree with the enclosing fn signature.

Re:Weird Expressions in Rust by steveklabnik on Friday June 27, 2025 @03:34PM (#44399604)
I replied over there, let's keep it to that sub-tree so we both don't have to duplicate comments :)