News for hackers. Stuff that matters.
Re:Rust Additions for GCC 15 Bring Support for If-Let Statem... by tialaramex on Monday March 24, 2025 @08:53AM (#43460501)
Yeah, I think it's non-obvious that you can name a lifetime 'frame not 'f - yes the compiler won't know you named it that because it's only supposed to live for one frame, but that's also true for your variable named timeout, Rust can see it's a Duration, so it has appropriate affordances, but it can't know you meant to call set_timeout(timeout) and not just store it somewhere.

I have a backlog item to find Rust docs which use a concise lifetime name but could value a better one, however there aren't actually that many cases other than the scoped threads which do indeed name the scopes 'scope and 'env showing that we can give these meaningful names.

There are no comments on this comment yet.