File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -3903,6 +3903,10 @@ fn test_single_channel_multiple_mpp() {
3903
3903
* nodes[ 6 ] . chain_monitor . write_blocker . lock ( ) . unwrap ( ) = Some ( blocker) ;
3904
3904
3905
3905
// Until we have std::thread::scoped we have to unsafe { turn off the borrow checker }.
3906
+ // We do this by casting a pointer to a `TestChannelManager` to a pointer to a
3907
+ // `TestChannelManager` with different (in this case 'static) lifetime.
3908
+ // This is even suggested in the second example at
3909
+ // https://doc.rust-lang.org/std/mem/fn.transmute.html#examples
3906
3910
let claim_node: & ' static TestChannelManager < ' static , ' static > =
3907
3911
unsafe { std:: mem:: transmute ( nodes[ 6 ] . node as & TestChannelManager ) } ;
3908
3912
let thrd = std:: thread:: spawn ( move || {
You can’t perform that action at this time.
0 commit comments