News for hackers. Stuff that matters.
Re:The Pain of Real Linear Types in Rust by belovedeagle on Tuesday May 09, 2017 @01:51PM (#14302327)
Which already exists in Rust in the form of... wait for it... the Drop trait. It's the same thing.
Re:The Pain of Real Linear Types in Rust by matt_kantor on Tuesday May 09, 2017 @02:52PM (#14302852)
The difference is that Go's `defer` is explicitly written out in the relevant scope, while Rust's `Drop` is implicit and defined elsewhere.
Re:The Pain of Real Linear Types in Rust by steveklabnik on Tuesday May 09, 2017 @02:59PM (#14302903)
There's a "scopeguard" crate that uses Drop to make it explicit.