@WG-prioritization/alerts issue #82533 has been requested for prioritization.
I-nominated
?hm ... what's the context of this issue? What's the actionable if (to my understanding by reading Joshua's comment) there's no memory leak?
I guess Joshua Nelson meant this is "just" a memory leak, it's fully safe.
Also IMO it's still called "panic safety" (or at least "unwind safety") even it's fully safe: https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html#what-is-unwind-safety
oh now I see, thank you!
hyd-dev said:
Also IMO it's still called "panic safety" (or at least "unwind safety") even it's fully safe: https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html#what-is-unwind-safety
Hmm, I don't think I'd call leaking memory a "broken logic invariant" - from what I can tell it's fine to catch the unwind and use the Vec after a panic
Joshua Nelson said:
Hmm, I don't think I'd call leaking memory a "broken logic invariant" - from what I can tell it's fine to catch the unwind and use the Vec after a panic
Indeed... OTOH "resource leaks" are not considered exception safe in C++: https://en.cppreference.com/w/cpp/language/exceptions#Exception_safety
But yes, although "panics in Rust are currently implemented essentially as a C++ exception under the hood", memory leak is mentioned in neither the documentation nor the RFC.
Maybe I just hate memory leaks too much. :losing_money:
yeah, I don't think C++ is super relevant to Rust's idea of unwind safety
I'd still label this P-high
. It may be safe, but we don't want to blow up memory in contexts where panics are common.
I don't think panics should be common :shrug: and if they are I'd expect a lot more things to break than just leaked memory
Then maybe we should document this, at least, in very big bold letters, that using panics for anything other than exit situations breaks things. Use std::Result
instead.
Sorry, I'm not explaining myself very well. I think catch_unwind is ok to use and won't inherently break things, just that in practice people don't consider it when writing libraries and so it doesn't get tested very well. I do think we should fix this if possible, I just don't think it's high priority.
P-medium
, then? P-low
is for things unlikely to get fixed, historically.
P-medium
seems fine to me.
I assigned a Prio, it went to this thread due to the issue title modification.