From 8646a1714306473011e79e1c1a213928bfa6025f Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 10 Jul 2018 20:39:28 +0200 Subject: Enforce #![deny(bare_trait_objects)] in src/libcore --- src/libcore/task/context.rs | 6 +++--- src/libcore/task/wake.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libcore/task') 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, + inner: NonNull, } 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) -> Self { + pub unsafe fn new(inner: NonNull) -> Self { Waker { inner: inner } } @@ -98,7 +98,7 @@ impl Drop for Waker { /// behavior. #[repr(transparent)] pub struct LocalWaker { - inner: NonNull, + inner: NonNull, } 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) -> Self { + pub unsafe fn new(inner: NonNull) -> Self { LocalWaker { inner: inner } } -- cgit 1.4.1-3-g733a5