From 58e1e5126ecfd0da99667d03209980d1a1dc66ac Mon Sep 17 00:00:00 2001 From: "Kevin R. Thornton" Date: Thu, 21 Sep 2023 10:13:05 -0700 Subject: [PATCH] new_borrowed was unsound due to hiding the coupled lifetime --- src/sys/tskbox.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/sys/tskbox.rs b/src/sys/tskbox.rs index 5dda8b27..be4863e0 100644 --- a/src/sys/tskbox.rs +++ b/src/sys/tskbox.rs @@ -21,15 +21,6 @@ impl TskBox { } } - pub fn new_borrowed(owner: &Self) -> Self { - let tsk = owner.tsk; - Self { - tsk, - teardown: None, - owning: false, - } - } - pub fn as_ref(&self) -> &T { unsafe { self.tsk.as_ref() } } @@ -86,10 +77,6 @@ fn test_miri() { }, teardown_x, ); - - let _ = TskBox::new_borrowed(&b); - - //is_send_sync(&b) } #[test] @@ -112,5 +99,4 @@ fn test_table_collection_tskbox_shared_ptr() { }, super::bindings::tsk_table_collection_free, ); - let _ = TskBox::new_borrowed(&tables); }