Remove impls for cases considered niche
This commit is contained in:
parent
fcc79f2d60
commit
8ce9c19b5b
2 changed files with 0 additions and 29 deletions
|
@ -902,16 +902,8 @@ impl<T> From<T> for Arc<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.6.0")]
|
|
||||||
impl<T> From<Box<T>> for Arc<T> {
|
|
||||||
fn from(t: Box<T>) -> Self {
|
|
||||||
Arc::new(*t)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::boxed::Box;
|
|
||||||
use std::clone::Clone;
|
use std::clone::Clone;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
use std::mem::drop;
|
use std::mem::drop;
|
||||||
|
@ -1161,13 +1153,6 @@ mod tests {
|
||||||
let foo_arc = Arc::from(foo);
|
let foo_arc = Arc::from(foo);
|
||||||
assert!(123 == *foo_arc);
|
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<T: ?Sized> borrow::Borrow<T> for Arc<T> {
|
impl<T: ?Sized> borrow::Borrow<T> for Arc<T> {
|
||||||
|
|
|
@ -706,13 +706,6 @@ impl<T> From<T> for Rc<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.6.0")]
|
|
||||||
impl<T> From<Box<T>> for Rc<T> {
|
|
||||||
fn from(t: Box<T>) -> Self {
|
|
||||||
Rc::new(*t)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A weak version of `Rc<T>`.
|
/// A weak version of `Rc<T>`.
|
||||||
///
|
///
|
||||||
/// Weak references do not count when determining if the inner value should be
|
/// 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);
|
let foo_rc = Rc::from(foo);
|
||||||
assert!(123 == *foo_rc);
|
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<T: ?Sized> borrow::Borrow<T> for Rc<T> {
|
impl<T: ?Sized> borrow::Borrow<T> for Rc<T> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue