Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRFC: Add linear type facility #814
Comments
pnkfelix
added
the
postponed
label
Feb 5, 2015
This comment has been minimized.
This comment has been minimized.
|
This may be useful to support |
This comment has been minimized.
This comment has been minimized.
Munksgaard
commented
Sep 15, 2015
|
Are there any plans for when we take this up again? #523 seems to be related, by the way. |
This comment has been minimized.
This comment has been minimized.
aidancully
commented
Sep 15, 2015
|
@Munksgaard I've factored some of this RFC out into #1180, and (opened a discussion on internals about another part)[https://internals.rust-lang.org/t/pre-rfc-excdrop-trait-for-different-drop-glue-during-unwinding/2242]. I've been working through an implementation of #1180, but real life is taking too much time to make any progress at all for probably the next month or so. |
This comment has been minimized.
This comment has been minimized.
Rufflewind
commented
Apr 17, 2017
|
Aside from fallible I think linear types are suited for transient, active things that need to be dealt with carefully and explicitly, whereas affine types are more like passive objects that could be thrown away without regard. Which one is more suitable for a particular resource is probably a bit subjective and dependent on the robustness and reliability demands. It might even be possible to have a rudimentary lint-based implementation of linear types: if an object gets dropped and the destructor unconditionally panics, then that’s almost certainly a bug and should be warned. |
This comment has been minimized.
This comment has been minimized.
How would that work? Presumably when people say linear types they don't mean types with values with an infinite lifetime, but rather that you need to pass them to some special destroy function by value when you're done with them. If you have a |
This comment has been minimized.
This comment has been minimized.
Rufflewind
commented
Apr 17, 2017
It’s not infinitely long, but the time at which it becomes destructible is not statically known, and may require the user to take certain actions before it becomes destructible.
Yes, panicking in |
pnkfelix commentedFeb 5, 2015
Rendered
Tracking issue for postponed PR #776