-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Switch from pin-project to pin-project-lite #2388
Comments
Considered, and agreed! It should be done! |
This may require taiki-e/pin-project-lite#43. UPDATE: merged and released in pin-project-lite 0.2.4. |
I'll take a stab at implementing this. |
Depends on taiki-e/pin-project-lite#25 because of Line 180 in fad42ac
|
Just found that out myself. Thanks for the link 🙂 |
Also depends on taiki-e/pin-project-lite#3 because of Lines 163 to 165 in c9c46ed
|
pin-project-lite#3 is about attributes that apply only to the original struct/enum. However, there is a known workaround for the cfg issue, and probably hyper can use it as well.
Something like: #[cfg(all(feature = "http1", feature = "http2"))]
#[derive(Clone, Debug)]
enum Fallback<E> { ... }
#[cfg(not(all(feature = "http1", feature = "http2")))]
#[derive(Clone, Debug)]
struct Fallback<E>(std::marker::PhantomData<E>);
pin_project! {
pub struct Connection<T, S, E = Exec>
where
S: HttpService<Body>,
{
pub(super) conn: Option<ProtoServer<T, S::ResBody, S, E>>,
fallback: Fallback<E>,
}
} |
The title and issue description are exactly about this. Anyway, thanks for providing a workaround, I'll apply that after taiki-e/pin-project-lite#25 is merged and I can finish my PR. |
Hmm, by the way that struct is not using |
Well, I agree that it is confusing.
Technically, |
I think I can merge that this weekend or the next week. (it only needs docs and tests) EDIT: It's no longer a blocker, so I postponed the merge. |
I had a look, this is the problematic type: an enum that uses
|
Working on this again, using the first solution I mentioned above (if still applicable). |
…2566) Note the practical affects of this change: - Dependency count with --features full dropped from 65 to 55. - Time to compile after a clean dropped from 48s to 35s (on a pretty underpowered VM). Closes hyperium#2388
futures-rs just switched and tokio has been using the
-lite
one since 0.2.0. I haven't used either so I don't actually know how hard switching is, but it seems like a good idea since it greatly improves compile times for people who don't depend on syn & quote otherwise.The text was updated successfully, but these errors were encountered: