-
Notifications
You must be signed in to change notification settings - Fork 282
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 #594
Comments
Looks like tower/tower/src/buffer/worker.rs Lines 23 to 24 in e1760d3
pin-project-lite doesn't support.
I think it may be possible to refactor the implementation somewhat so that the drop impl is not needed. We could probably add a wrapper struct around just the semaphore with a |
Started the grind-work part of this migration. Two limitations of
This means each |
No. I recently added support for it: https://github.com/taiki-e/pin-project-lite/releases/tag/v0.2.7 |
And implemented for buffer::Worker @taiki-e is there anything preventing trait bounds on the |
Hmm, that's odd... I'll take a look later. |
64: Pinned drop bounds bug r=taiki-e a=Michael-J-Ward The bug brought up in [this conversation](tower-rs/tower#594 (comment)) Simple fix, the parsing grammar wasn't handling trailing commas. Co-authored-by: Michael J Ward <[email protected]>
In practice I've found `Either` be hard to use since it changes the error type to `BoxError`. That means if you combine two infallible services you get a service that, to the type system, is fallible. That doesn't work well with [axum's error handling](https://docs.rs/axum/latest/axum/error_handling/index.html) model which requires all services to be infallible and thus always return a response. So you end up having to add boilerplate just to please the type system. Additionally, the fact that `Either` implements `Future` also means we cannot fully remove the dependency on `pin-project` since `pin-project-lite` doesn't support tuple enum variants, only named fields. This PR reworks `Either` to address these: - It now requires the two services to have the same error type so no type information is lost. I did consider doing something like `where B::Error: From<A::Error>` but I hope this simpler model will lead to better compiler errors. - Changes the response future to be a struct with a private enum using `pin-project-lite` - Removes the `Future` impl so we can remove the dependency on `pin-project` Goes without saying that this is a breaking change so we have to wait until tower 0.5 to ship this. cc @jplatte Fixes #594 Fixes #550
I doubt we actually need the extra features of the former, and changing to to "lite" will be a compilation speed improvement.
The text was updated successfully, but these errors were encountered: