auto merge of #14616 : forticulous/rust/rc-show, r=alexcrichton
Show impl for Rc
This commit is contained in:
commit
a6401b5226
|
@ -33,6 +33,7 @@ use core::option::{Option, Some, None};
|
||||||
use core::ptr;
|
use core::ptr;
|
||||||
use core::ptr::RawPtr;
|
use core::ptr::RawPtr;
|
||||||
use core::mem::{min_align_of, size_of};
|
use core::mem::{min_align_of, size_of};
|
||||||
|
use core::fmt;
|
||||||
|
|
||||||
use heap::deallocate;
|
use heap::deallocate;
|
||||||
|
|
||||||
|
@ -178,6 +179,12 @@ impl<T: Ord> Ord for Rc<T> {
|
||||||
fn cmp(&self, other: &Rc<T>) -> Ordering { (**self).cmp(&**other) }
|
fn cmp(&self, other: &Rc<T>) -> Ordering { (**self).cmp(&**other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: fmt::Show> fmt::Show for Rc<T> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
(**self).fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Weak reference to a reference-counted box
|
/// Weak reference to a reference-counted box
|
||||||
#[unsafe_no_drop_flag]
|
#[unsafe_no_drop_flag]
|
||||||
pub struct Weak<T> {
|
pub struct Weak<T> {
|
||||||
|
|
Loading…
Reference in New Issue