diff --git a/actix-rt/src/arbiter.rs b/actix-rt/src/arbiter.rs index 44e34b5d..72e2d3e3 100644 --- a/actix-rt/src/arbiter.rs +++ b/actix-rt/src/arbiter.rs @@ -218,11 +218,13 @@ impl Arbiter { /// Insert item into Arbiter's thread-local storage. /// /// Overwrites any item of the same type previously inserted. + #[deprecated = "Will be removed in stable v2."] pub fn set_item(item: T) { STORAGE.with(move |cell| cell.borrow_mut().insert(TypeId::of::(), Box::new(item))); } /// Check if Arbiter's thread-local storage contains an item type. + #[deprecated = "Will be removed in stable v2."] pub fn contains_item() -> bool { STORAGE.with(move |cell| cell.borrow().contains_key(&TypeId::of::())) } @@ -231,6 +233,7 @@ impl Arbiter { /// /// # Panics /// Panics if item is not in Arbiter's thread-local item storage. + #[deprecated = "Will be removed in stable v2."] pub fn get_item(mut f: F) -> R where F: FnMut(&T) -> R, @@ -249,6 +252,7 @@ impl Arbiter { /// /// # Panics /// Panics if item is not in Arbiter's thread-local item storage. + #[deprecated = "Will be removed in stable v2."] pub fn get_mut_item(mut f: F) -> R where F: FnMut(&mut T) -> R, diff --git a/actix-rt/tests/tests.rs b/actix-rt/tests/tests.rs index b2607a91..56ac2017 100644 --- a/actix-rt/tests/tests.rs +++ b/actix-rt/tests/tests.rs @@ -141,6 +141,7 @@ fn arbiter_drop_no_panic_fut() { } #[test] +#[allow(deprecated)] fn arbiter_item_storage() { let _ = System::new();