about summary refs log tree commit diff
path: root/src/libcore/task
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-07-10 20:39:28 +0200
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>2018-07-25 10:21:41 +0900
commit8646a1714306473011e79e1c1a213928bfa6025f (patch)
tree2c8c4d403782936f31140895a36a9da6126e433c /src/libcore/task
parent46804ef0cee4b55ed9922719da243b6edd9101b2 (diff)
downloadrust-8646a1714306473011e79e1c1a213928bfa6025f.tar.gz
rust-8646a1714306473011e79e1c1a213928bfa6025f.zip
Enforce #![deny(bare_trait_objects)] in src/libcore
Diffstat (limited to 'src/libcore/task')
-rw-r--r--src/libcore/task/context.rs6
-rw-r--r--src/libcore/task/wake.rs8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libcore/task/context.rs b/src/libcore/task/context.rs
index c69d45248a5..1fc975cb178 100644
--- a/src/libcore/task/context.rs
+++ b/src/libcore/task/context.rs
@@ -21,7 +21,7 @@ use super::{Executor, Waker, LocalWaker};
 /// when performing a single `poll` step on a task.
 pub struct Context<'a> {
     local_waker: &'a LocalWaker,
-    executor: &'a mut Executor,
+    executor: &'a mut dyn Executor,
 }
 
 impl<'a> fmt::Debug for Context<'a> {
@@ -34,7 +34,7 @@ impl<'a> fmt::Debug for Context<'a> {
 impl<'a> Context<'a> {
     /// Create a new task `Context` with the provided `local_waker`, `waker`, and `executor`.
     #[inline]
-    pub fn new(local_waker: &'a LocalWaker, executor: &'a mut Executor) -> Context<'a> {
+    pub fn new(local_waker: &'a LocalWaker, executor: &'a mut dyn Executor) -> Context<'a> {
         Context {
             local_waker,
             executor,
@@ -58,7 +58,7 @@ impl<'a> Context<'a> {
     /// This method is useful primarily if you want to explicitly handle
     /// spawn failures.
     #[inline]
-    pub fn executor(&mut self) -> &mut Executor {
+    pub fn executor(&mut self) -> &mut dyn Executor {
         self.executor
     }
 
diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs
index 3b901c9aef0..321b432d3f4 100644
--- a/src/libcore/task/wake.rs
+++ b/src/libcore/task/wake.rs
@@ -23,7 +23,7 @@ use ptr::NonNull;
 /// trait, allowing notifications to get routed through it.
 #[repr(transparent)]
 pub struct Waker {
-    inner: NonNull<UnsafeWake>,
+    inner: NonNull<dyn UnsafeWake>,
 }
 
 impl Unpin for Waker {}
@@ -41,7 +41,7 @@ impl Waker {
     /// use the `Waker::from` function instead which works with the safe
     /// `Arc` type and the safe `Wake` trait.
     #[inline]
-    pub unsafe fn new(inner: NonNull<UnsafeWake>) -> Self {
+    pub unsafe fn new(inner: NonNull<dyn UnsafeWake>) -> Self {
         Waker { inner: inner }
     }
 
@@ -98,7 +98,7 @@ impl Drop for Waker {
 /// behavior.
 #[repr(transparent)]
 pub struct LocalWaker {
-    inner: NonNull<UnsafeWake>,
+    inner: NonNull<dyn UnsafeWake>,
 }
 
 impl Unpin for LocalWaker {}
@@ -119,7 +119,7 @@ impl LocalWaker {
     /// For this function to be used safely, it must be sound to call `inner.wake_local()`
     /// on the current thread.
     #[inline]
-    pub unsafe fn new(inner: NonNull<UnsafeWake>) -> Self {
+    pub unsafe fn new(inner: NonNull<dyn UnsafeWake>) -> Self {
         LocalWaker { inner: inner }
     }