We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f428943 commit c6bbb99Copy full SHA for c6bbb99
lightning/src/ln/chanmon_update_fail_tests.rs
@@ -3903,6 +3903,10 @@ fn test_single_channel_multiple_mpp() {
3903
*nodes[6].chain_monitor.write_blocker.lock().unwrap() = Some(blocker);
3904
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
3910
let claim_node: &'static TestChannelManager<'static, 'static> =
3911
unsafe { std::mem::transmute(nodes[6].node as &TestChannelManager) };
3912
let thrd = std::thread::spawn(move || {
0 commit comments