3 ms·
We may end up adding linear types, not just affine, to Rust as well: https://github.com/rust-lang/rfcs/issues/814 https://github.com/rust-lang/rfcs/issues/814
by steveklabnik 12y ago
We may end up adding linear types, not just affine, to Rust as well: https://github.com/rust-lang/rfcs/issues/814 https://github.com/rust-lang/rfcs/issues/814
- cwzwarich 12y agoFrom 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."
- steveklabnik 12y agoOh interesting, I'd missed that. Thanks!
- arielby 12y agoRust always has unwinding, and the finalizer can just call `abort` to make this as linear as you can.
- deleted 12y ago[deleted]
- Argorak 12y agoInteresting. 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-errors-on-drop/1662 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=skade http://internals.rust-lang.org/t/issues-in-new-i-o/1658/4?u=...