Hacker News new | past | comments | ask | show | jobs | submit login

We may end up adding linear types, not just affine, to Rust as well: https://github.com/rust-lang/rfcs/issues/814



From the RFC you linked:

"First, the `linear` attribute as described here does not create true `linear` types: when unwinding past a `linear` type, the `linear` attribute will be ignored, and a `Finalize` trait could be invoked. Supporting unwinding means that Rust's linear types would in effect still be affine."


Rust always has unwinding, and the finalizer can just call `abort` to make this as linear as you can.


Oh interesting, I'd missed that. Thanks!


Interesting. Could that also help with types that should actually be explicitly dropped, like this case?

http://internals.rust-lang.org/t/std-fs-tempdir-ignoring-err...

Edit: yep, it was mentioned in the discussion here. http://internals.rust-lang.org/t/issues-in-new-i-o/1658/4?u=...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: