top | item 37549043

(no title)

workingjubilee | 2 years ago

You have not described a mechanism or API by which the compiler or programmer could enforce that only Leak types are on the stack and that a longjmp will not traverse `!Leak` types. And the only real way to get this would be to describe an interface that would have to be variadic to allow calling functions in general, as you would have to ensure that all args to a given `impl Fn*` are `T: Leak` for `T0` through `Tn`, and Rust currently lacks variadic generics. At that point, you might as well just do the same for `!Drop`.

discuss

order

jeff-davis|2 years ago

I'd be happy if there were a way to always unwind when a longjmp() happens, regardless of whether there are !Leak types on the stack.