-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update axum from 0.6 to 0.7 #16
Comments
Just updated axum to 0.71 and everything seems fine except for some errors I get when trying to compile. Apparently as soon as I use code like this:
with the following errors: error[E0277]: the trait bound `fn(axum::extract::State<std::sync::Arc<backend_state::BackendState>>, helpers::ExtractDeviceId, axum_valid::Valid<axum::Json<news::models::NewsNew>>) -> impl futures::Future<Output = std::result::Result<impl axum::response::IntoResponse, errors::ApiError>> {news::routes::post_news}: axum::handler::Handler<_, std::sync::Arc<backend_state::BackendState>>` is not satisfied
--> src/news/routes.rs:22:59
|
22 | .route("/v1/news", get(get_news_for_project).post(post_news))
| ---- ^^^^^^^^^ the trait `axum::handler::Handler<_, std::sync::Arc<backend_state::BackendState>>` is not implemented for fn item `fn(axum::extract::State<std::sync::Arc<backend_state::BackendState>>, helpers::ExtractDeviceId, axum_valid::Valid<axum::Json<news::models::NewsNew>>) -> impl futures::Future<Output = std::result::Result<impl axum::response::IntoResponse, errors::ApiError>> {news::routes::post_news}`
| |
| required by a bound introduced by this call
|
help: trait impls with same name found
--> /Users/bbense/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.6.20/src/handler/mod.rs:198:1
|
198 | impl<F, Fut, Res, S, B> Handler<((),), S, B> for F
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
257 | all_the_tuples!(impl_handler);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
265 | impl<T, S, B> Handler<private::IntoResponseHandler, S, B> for T
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `axum` are being used?
= help: the following other types implement trait `axum::handler::Handler<T, S>`:
<axum::handler::Layered<L, H, T, S> as axum::handler::Handler<T, S>>
<axum::routing::MethodRouter<S> as axum::handler::Handler<(), S>>
note: required by a bound in `axum::routing::MethodRouter::<S>::post`
--> /Users/bbense/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.7.1/src/routing/method_routing.rs:590:5
|
590 | chained_handler_fn!(post, POST);
| ^^^^^^^^^^^^^^^^^^^^----^^^^^^^
| | |
| | required by a bound in this associated function
| required by this bound in `MethodRouter::<S>::post`
= note: this error originates in the macro `impl_handler` which comes from the expansion of the macro `chained_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info) Apparently, something is not quite right with the return type that axum expects now. |
Try 0.12.0-alpha. If you encounter any issues or have specific questions, feel free to let me know, thx. |
Just tried 0.12.0-alpha and it seems to compile just fine now. Will report back if I see any other bugs or side effects. Thanks for the quick response! 👍 |
Awesome 🥳 |
Yaml
fromaxum-serde
MsgPack
andMsgPackRaw
fromaxum-serde
build(deps): update axum requirement from 0.6.0 to 0.7.1 murar8/axum_typed_multipart#59The text was updated successfully, but these errors were encountered: