From 6fbaf7daf9ed59c2b7d7b5ca743977584bba0636 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Sun, 25 Nov 2018 13:12:21 +0100 Subject: [PATCH] Future is now object safe --- futures-core/src/future/future_obj.rs | 5 ----- futures-core/src/stream/stream_obj.rs | 5 ----- 2 files changed, 10 deletions(-) diff --git a/futures-core/src/future/future_obj.rs b/futures-core/src/future/future_obj.rs index bfb91a9380..1d73f41533 100644 --- a/futures-core/src/future/future_obj.rs +++ b/futures-core/src/future/future_obj.rs @@ -12,11 +12,6 @@ use core::{ /// This custom trait object was introduced for two reasons: /// - Currently it is not possible to take `dyn Trait` by value and /// `Box` is not available in no_std contexts. -/// - The `Future` trait is currently not object safe: The `Future::poll` -/// method makes uses the arbitrary self types feature and traits in which -/// this feature is used are currently not object safe due to current compiler -/// limitations. (See tracking issue for arbitrary self types for more -/// information #44874) pub struct LocalFutureObj<'a, T> { ptr: *mut (), poll_fn: unsafe fn(*mut (), &LocalWaker) -> Poll, diff --git a/futures-core/src/stream/stream_obj.rs b/futures-core/src/stream/stream_obj.rs index a676ab6855..93c6df4e54 100644 --- a/futures-core/src/stream/stream_obj.rs +++ b/futures-core/src/stream/stream_obj.rs @@ -11,11 +11,6 @@ use core::pin::Pin; /// This custom trait object was introduced for two reasons: /// - Currently it is not possible to take `dyn Trait` by value and /// `Box` is not available in no_std contexts. -/// - The `Stream` trait is currently not object safe: The `Stream::poll_next` -/// method makes uses the arbitrary self types feature and traits in which -/// this feature is used are currently not object safe due to current compiler -/// limitations. (See tracking issue for arbitrary self types for more -/// information #44874) pub struct LocalStreamObj<'a, T> { ptr: *mut (), poll_next_fn: unsafe fn(*mut (), &LocalWaker) -> Poll>,