Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PinMut::get_mut_unchecked, Add Sized bound to poll_unpin #1049

Merged
merged 1 commit into from
Jun 27, 2018

Conversation

MajorBreakfast
Copy link
Contributor

@MajorBreakfast MajorBreakfast commented Jun 27, 2018

The new nightly (84804c387 2018-06-26) includes PinMut::get_mut & get_mut_unchecked!

  • Replace PinMut::get_mut with get_mut_unchecked (this was renamed)
  • Remove workaround that was used because the safe PinMut::get_mut didn't exist
  • Use unsafe_pinned! macro in FutureOption
  • Add Sized bound to poll_unpin methods. See error log below. I'm not sure how best to resolve this
Error log: The trait cannot be made into an object
error: the trait `stream::Stream` cannot be made into an object
  --> futures-core/src/stream/mod.rs:51:5
   |
51 | /     fn poll_next_unpin(&mut self, cx: &mut task::Context) -> Poll<Option<Self::Item>>
52 | |         where Self: Unpin
53 | |     {
54 | |         PinMut::new(self).poll_next(cx)
55 | |     }
   | |_____^
   |
note: lint level defined here
  --> futures-core/src/lib.rs:7:54
   |
7  | #![deny(missing_docs, missing_debug_implementations, warnings)]
   |                                                      ^^^^^^^^
   = note: #[deny(where_clauses_object_safety)] implied by #[deny(warnings)]
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #51443 <https://github.com/rust-lang/rust/issues/51443>
   = note: method `poll_next_unpin` references the `Self` type in where clauses

error: the trait `future::CoreFutureExt` cannot be made into an object
  --> futures-core/src/future/mod.rs:20:5
   |
20 | /     fn poll_unpin(&mut self, cx: &mut task::Context) -> Poll<Self::Output>
21 | |         where Self: Unpin
22 | |     {
23 | |         PinMut::new(self).poll(cx)
24 | |     }
   | |_____^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #51443 <https://github.com/rust-lang/rust/issues/51443>
   = note: method `poll_unpin` references the `Self` type in where clauses

error: the trait `stream::Stream` cannot be made into an object
  --> futures-core/src/stream/mod.rs:51:5
   |
51 | /     fn poll_next_unpin(&mut self, cx: &mut task::Context) -> Poll<Option<Self::Item>>
52 | |         where Self: Unpin
53 | |     {
54 | |         PinMut::new(self).poll_next(cx)
55 | |     }
   | |_____^
   |
note: lint level defined here
  --> futures-core/src/lib.rs:7:54
   |
7  | #![deny(missing_docs, missing_debug_implementations, warnings)]
   |                                                      ^^^^^^^^
   = note: #[deny(where_clauses_object_safety)] implied by #[deny(warnings)]
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #51443 <https://github.com/rust-lang/rust/issues/51443>
   = note: method `poll_next_unpin` references the `Self` type in where clauses

error: the trait `future::CoreFutureExt` cannot be made into an object
  --> futures-core/src/future/mod.rs:20:5
   |
20 | /     fn poll_unpin(&mut self, cx: &mut task::Context) -> Poll<Self::Output>
21 | |         where Self: Unpin
22 | |     {
23 | |         PinMut::new(self).poll(cx)
24 | |     }
   | |_____^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #51443 <https://github.com/rust-lang/rust/issues/51443>
   = note: method `poll_unpin` references the `Self` type in where clauses

@cramertj
Copy link
Member

@MajorBreakfast LGTM-- I'll leave a comment on rust-lang/rust#51443.

@cramertj cramertj merged commit 5c3cff4 into rust-lang:0.3 Jun 27, 2018
@MajorBreakfast
Copy link
Contributor Author

ˋpoll_unpin()ˋ will be less useful until this is sorted out. However we don‘t need to rely on it. I suppose this is also why it wasn‘t put into core. ˋPinMut:new()ˋ works just fine for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants