diff options
| author | P1start <rewi-github@whanau.org> | 2015-04-23 22:53:54 +1200 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2015-05-02 10:03:35 +1200 |
| commit | 57d8289754767e046a01abaab6054b7146c51f74 (patch) | |
| tree | 48a7cfe6525cdc6d0c5431e982cc3de0b1bd2aaa /src/libcore/fmt | |
| parent | 5c710b593b429d39ea01375172a9ce968f43ab26 (diff) | |
| download | rust-57d8289754767e046a01abaab6054b7146c51f74.tar.gz rust-57d8289754767e046a01abaab6054b7146c51f74.zip | |
Make `UnsafeCell`, `RefCell`, `Mutex`, and `RwLock` accept DSTs
This + DST coercions (#24619) would allow code like `Rc<RefCell<Box<Trait>>>` to be simplified to `Rc<RefCell<Trait>>`.
Diffstat (limited to 'src/libcore/fmt')
| -rw-r--r-- | src/libcore/fmt/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 73778bfd038..f8a1ef96bcc 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -1062,7 +1062,7 @@ impl<T: Copy + Debug> Debug for Cell<T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<T: Debug> Debug for RefCell<T> { +impl<T: ?Sized + Debug> Debug for RefCell<T> { fn fmt(&self, f: &mut Formatter) -> Result { match self.borrow_state() { BorrowState::Unused | BorrowState::Reading => { @@ -1074,14 +1074,14 @@ impl<T: Debug> Debug for RefCell<T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'b, T: Debug> Debug for Ref<'b, T> { +impl<'b, T: ?Sized + Debug> Debug for Ref<'b, T> { fn fmt(&self, f: &mut Formatter) -> Result { Debug::fmt(&**self, f) } } #[stable(feature = "rust1", since = "1.0.0")] -impl<'b, T: Debug> Debug for RefMut<'b, T> { +impl<'b, T: ?Sized + Debug> Debug for RefMut<'b, T> { fn fmt(&self, f: &mut Formatter) -> Result { Debug::fmt(&*(self.deref()), f) } |
