-
Notifications
You must be signed in to change notification settings - Fork 647
Remove uses of pin_project::project attribute #2176
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
Conversation
pin-project will deprecate the project attribute due to some unfixable limitations. Refs: taiki-e/pin-project#225
|
||
use crate::fns::FnOnce1; | ||
|
||
/// Internal Map future | ||
#[pin_project(Replace)] | ||
#[pin_project(Replace, project = MapProj, project_replace = MapProjOwn)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not ideal that we need to have both Replace
and project_replace = <name>
as project_replace = <name>
implies that a project_replace
method is generated.
I'll fix it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in pin-project 0.4.20 (taiki-e/pin-project#243)
243: Allow `project_replace` argument to be used without `Replace` r=taiki-e a=taiki-e Currently, both `Replace` and `project_replace = <name>` arguments are required to name the return value of `project_replace()` method. ```rust #[pin_project(Replace, project_replace = EnumProjOwn)] enum Enum<T> { Variant(#[pin] T) } ``` It is not ideal that we need to have both `Replace` and `project_replace = <name>` as `project_replace = <name>` implies that a `project_replace` method is generated. This PR makes `project_replace` argument to use without `Replace` argument. ```diff - #[pin_project(Replace, project_replace = EnumProjOwn)] + #[pin_project(project_replace = EnumProjOwn)] enum Enum<T> { Variant(#[pin] T) } ``` Also, makes `project_replace` argument an alias for `Replace` so that it can be used without a value. ```rust #[pin_project(project_replace)] enum Enum<T> { Variant(#[pin] T) } ``` Related: rust-lang/futures-rs#2176 (comment) hyperium/hyper#2220 (comment) Co-authored-by: Taiki Endo <[email protected]>
Thanks! The number of PRs you've done for this deprecation is pretty epic 😁 |
Remove uses of pin_project::project attribute
Remove uses of pin_project::project attribute
pin-project will deprecate the project attribute due to some unfixable
limitations.
Refs: taiki-e/pin-project#225
Although the deprecation of the project attribute has not been released yet, this PR is submitted in advance to avoid the CI from being broken by deprecated warnings.