You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a task fails, and then during the unwind some code in a destructor calls write on a RWArc, the RWArc is poisoned. I think this is a bug. I would expect a failure that happened during one of the closures passed to write to poison it, but not a call to write that happened within a destructor during an unwind from a failure that had already occurred.
Here is some sample code that exhibits the problem--it gives the error message 'Poisoned rw_arc - another task failed inside!' whereas I would expect it to print 5:
externmod extra;use extra::arc::RWArc;use std::task;structUnwinder{i:RWArc<int>}implDropforUnwinder{fndrop(&mutself){self.i.write(|num| {*num += 3;});}}fnmain(){let a = RWArc::<int>::new(2);let a_copy = a.clone();
do task::try::<()>{
let _u = Unwinder{i:a_copy};fail!();};
a.write(|num| {println!("{:d}",*num);});}
The text was updated successfully, but these errors were encountered:
Return `Some` from `walk_to_expr_usage` more
fixesrust-lang#11786
supersedes rust-lang#11097
The code removed in the first commit would have needed changes due to the second commit. Since it's useless it just gets removed instead.
changelog: `needless_borrow`: Fix linting in tuple and array expressions.
If a task fails, and then during the unwind some code in a destructor calls
write
on aRWArc
, theRWArc
is poisoned. I think this is a bug. I would expect a failure that happened during one of the closures passed towrite
to poison it, but not a call towrite
that happened within a destructor during an unwind from a failure that had already occurred.Here is some sample code that exhibits the problem--it gives the error message
'Poisoned rw_arc - another task failed inside!'
whereas I would expect it to print5
:The text was updated successfully, but these errors were encountered: