From 8ce9c19b5bf6259eeaa4482a824893cdf3dfe0e3 Mon Sep 17 00:00:00 2001 From: Alexander Bulaev Date: Thu, 12 Nov 2015 10:40:02 +0300 Subject: [PATCH] Remove impls for cases considered `niche` --- src/liballoc/arc.rs | 15 --------------- src/liballoc/rc.rs | 14 -------------- 2 files changed, 29 deletions(-) diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 36f915d19e9..a2ccac3ba7e 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -902,16 +902,8 @@ impl From for Arc { } } -#[stable(feature = "rust1", since = "1.6.0")] -impl From> for Arc { - fn from(t: Box) -> Self { - Arc::new(*t) - } -} - #[cfg(test)] mod tests { - use std::boxed::Box; use std::clone::Clone; use std::sync::mpsc::channel; use std::mem::drop; @@ -1161,13 +1153,6 @@ mod tests { let foo_arc = Arc::from(foo); assert!(123 == *foo_arc); } - - #[test] - fn test_from_box() { - let foo_box = Box::new(123); - let foo_arc = Arc::from(foo_box); - assert!(123 == *foo_arc); - } } impl borrow::Borrow for Arc { diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index e7deceb94c3..626abb0b43a 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -706,13 +706,6 @@ impl From for Rc { } } -#[stable(feature = "rust1", since = "1.6.0")] -impl From> for Rc { - fn from(t: Box) -> Self { - Rc::new(*t) - } -} - /// A weak version of `Rc`. /// /// Weak references do not count when determining if the inner value should be @@ -1128,13 +1121,6 @@ mod tests { let foo_rc = Rc::from(foo); assert!(123 == *foo_rc); } - - #[test] - fn test_from_box() { - let foo_box = Box::new(123); - let foo_rc = Rc::from(foo_box); - assert!(123 == *foo_rc); - } } impl borrow::Borrow for Rc {