Skip to content

Commit 8ce9c19

Browse files
committed
Remove impls for cases considered niche
1 parent fcc79f2 commit 8ce9c19

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/liballoc/arc.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -902,16 +902,8 @@ impl<T> From<T> for Arc<T> {
902902
}
903903
}
904904

905-
#[stable(feature = "rust1", since = "1.6.0")]
906-
impl<T> From<Box<T>> for Arc<T> {
907-
fn from(t: Box<T>) -> Self {
908-
Arc::new(*t)
909-
}
910-
}
911-
912905
#[cfg(test)]
913906
mod tests {
914-
use std::boxed::Box;
915907
use std::clone::Clone;
916908
use std::sync::mpsc::channel;
917909
use std::mem::drop;
@@ -1161,13 +1153,6 @@ mod tests {
11611153
let foo_arc = Arc::from(foo);
11621154
assert!(123 == *foo_arc);
11631155
}
1164-
1165-
#[test]
1166-
fn test_from_box() {
1167-
let foo_box = Box::new(123);
1168-
let foo_arc = Arc::from(foo_box);
1169-
assert!(123 == *foo_arc);
1170-
}
11711156
}
11721157

11731158
impl<T: ?Sized> borrow::Borrow<T> for Arc<T> {

src/liballoc/rc.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -706,13 +706,6 @@ impl<T> From<T> for Rc<T> {
706706
}
707707
}
708708

709-
#[stable(feature = "rust1", since = "1.6.0")]
710-
impl<T> From<Box<T>> for Rc<T> {
711-
fn from(t: Box<T>) -> Self {
712-
Rc::new(*t)
713-
}
714-
}
715-
716709
/// A weak version of `Rc<T>`.
717710
///
718711
/// Weak references do not count when determining if the inner value should be
@@ -1128,13 +1121,6 @@ mod tests {
11281121
let foo_rc = Rc::from(foo);
11291122
assert!(123 == *foo_rc);
11301123
}
1131-
1132-
#[test]
1133-
fn test_from_box() {
1134-
let foo_box = Box::new(123);
1135-
let foo_rc = Rc::from(foo_box);
1136-
assert!(123 == *foo_rc);
1137-
}
11381124
}
11391125

11401126
impl<T: ?Sized> borrow::Borrow<T> for Rc<T> {

0 commit comments

Comments
 (0)