Would running test-to-destruction cases that are expected to fail count as
"running in a sandbox"? Currently I spawn them to a separate task and catch
its failure, which is probably better practice - but it would be nice if I
were able to access the message given to fail and compare it with the
expected one. If the unsafe catch would allow for that, it may be
worthwhile to switch to it...


On Fri, Sep 20, 2013 at 4:54 PM, Patrick Walton <pwal...@mozilla.com> wrote:

> On 9/19/13 11:40 PM, Jason E. Aten wrote:
>
>> Agreed. I'm convinced that fail! should result in an almost-magical
>> "lets pretend that never happened" jump back in time.
>>
>
> I'm personally fine with adding an unsafe "catch" function or form that
> will stop unwinding if you absolutely have to use it, incidentally. In
> general fail! is not supposed to be used as an exception mechanism, because
> monadic use of Result does that better. But if you're doing special things
> like trying to sandbox Rust code, it seems relatively harmless to me. We
> already have all the low-level infrastructure (DWARF unwinding based C++
> exceptions) necessary to make it work...
>
> Patrick
>
> ______________________________**_________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/**listinfo/rust-dev<https://mail.mozilla.org/listinfo/rust-dev>
>
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to