about summary refs log tree commit diff
path: root/src/librustc_data_structures/owning_ref/mod.rs
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-07-11 13:58:27 +0200
committerljedrz <ljedrz@gmail.com>2018-07-11 13:58:27 +0200
commitff65bbe96a4ef301673eb5934649019991dbef0a (patch)
tree79dee8b71096ac7633ff28640fb042cde062192f /src/librustc_data_structures/owning_ref/mod.rs
parentae5b629efd79de78e6ba7ef493c32857bd7f9cf9 (diff)
downloadrust-ff65bbe96a4ef301673eb5934649019991dbef0a.tar.gz
rust-ff65bbe96a4ef301673eb5934649019991dbef0a.zip
Deny bare trait objects in in src/librustc_data_structures
Diffstat (limited to 'src/librustc_data_structures/owning_ref/mod.rs')
-rw-r--r--src/librustc_data_structures/owning_ref/mod.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/librustc_data_structures/owning_ref/mod.rs b/src/librustc_data_structures/owning_ref/mod.rs
index aa113fac9fb..7bd297b1551 100644
--- a/src/librustc_data_structures/owning_ref/mod.rs
+++ b/src/librustc_data_structures/owning_ref/mod.rs
@@ -1046,7 +1046,7 @@ unsafe impl<O, T: ?Sized> Send for OwningRefMut<O, T>
 unsafe impl<O, T: ?Sized> Sync for OwningRefMut<O, T>
     where O: Sync, for<'a> (&'a mut T): Sync {}
 
-impl Debug for Erased {
+impl Debug for dyn Erased {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "<Erased>",)
     }
@@ -1166,35 +1166,35 @@ pub type MutexGuardRefMut<'a, T, U = T> = OwningRefMut<MutexGuard<'a, T>, U>;
 pub type RwLockWriteGuardRefMut<'a, T, U = T> = OwningRef<RwLockWriteGuard<'a, T>, U>;
 
 unsafe impl<'a, T: 'a> IntoErased<'a> for Box<T> {
-    type Erased = Box<Erased + 'a>;
+    type Erased = Box<dyn Erased + 'a>;
     fn into_erased(self) -> Self::Erased {
         self
     }
 }
 unsafe impl<'a, T: 'a> IntoErased<'a> for Rc<T> {
-    type Erased = Rc<Erased + 'a>;
+    type Erased = Rc<dyn Erased + 'a>;
     fn into_erased(self) -> Self::Erased {
         self
     }
 }
 unsafe impl<'a, T: 'a> IntoErased<'a> for Arc<T> {
-    type Erased = Arc<Erased + 'a>;
+    type Erased = Arc<dyn Erased + 'a>;
     fn into_erased(self) -> Self::Erased {
         self
     }
 }
 
 unsafe impl<'a, T: Send + 'a> IntoErasedSend<'a> for Box<T> {
-    type Erased = Box<Erased + Send + 'a>;
+    type Erased = Box<dyn Erased + Send + 'a>;
     fn into_erased_send(self) -> Self::Erased {
         self
     }
 }
 
 unsafe impl<'a, T: Send + 'a> IntoErasedSendSync<'a> for Box<T> {
-    type Erased = Box<Erased + Sync + Send + 'a>;
+    type Erased = Box<dyn Erased + Sync + Send + 'a>;
     fn into_erased_send_sync(self) -> Self::Erased {
-        let result: Box<Erased + Send + 'a> = self;
+        let result: Box<dyn Erased + Send + 'a> = self;
         // This is safe since Erased can always implement Sync
         // Only the destructor is available and it takes &mut self
         unsafe {
@@ -1204,21 +1204,21 @@ unsafe impl<'a, T: Send + 'a> IntoErasedSendSync<'a> for Box<T> {
 }
 
 unsafe impl<'a, T: Send + Sync + 'a> IntoErasedSendSync<'a> for Arc<T> {
-    type Erased = Arc<Erased + Send + Sync + 'a>;
+    type Erased = Arc<dyn Erased + Send + Sync + 'a>;
     fn into_erased_send_sync(self) -> Self::Erased {
         self
     }
 }
 
 /// Typedef of a owning reference that uses an erased `Box` as the owner.
-pub type ErasedBoxRef<U> = OwningRef<Box<Erased>, U>;
+pub type ErasedBoxRef<U> = OwningRef<Box<dyn Erased>, U>;
 /// Typedef of a owning reference that uses an erased `Rc` as the owner.
-pub type ErasedRcRef<U> = OwningRef<Rc<Erased>, U>;
+pub type ErasedRcRef<U> = OwningRef<Rc<dyn Erased>, U>;
 /// Typedef of a owning reference that uses an erased `Arc` as the owner.
-pub type ErasedArcRef<U> = OwningRef<Arc<Erased>, U>;
+pub type ErasedArcRef<U> = OwningRef<Arc<dyn Erased>, U>;
 
 /// Typedef of a mutable owning reference that uses an erased `Box` as the owner.
-pub type ErasedBoxRefMut<U> = OwningRefMut<Box<Erased>, U>;
+pub type ErasedBoxRefMut<U> = OwningRefMut<Box<dyn Erased>, U>;
 
 #[cfg(test)]
 mod tests {