Comment

Comment by Panzerschrek

> If you didn't have that guarantee, at worst your mutex's guard object would be immediately dropped

For named local variables it's a different story. They should remain alive until the end of their lexical scope. But for unnamed temporaries created in expressions different rules should apply - as soon as there is no reference to such temporary, it should be destroyed.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton