Fix nightly tests?

This commit is contained in:
Jonas Platte 2023-12-30 23:49:52 +01:00
parent b8f499e774
commit 226a27e450
11 changed files with 106 additions and 89 deletions

View file

@ -15,7 +15,7 @@ error[E0277]: the trait bound `bool: FromRequestParts<()>` is not satisfied
<Version as FromRequestParts<S>>
<Extensions as FromRequestParts<S>>
<ConnectInfo<T> as FromRequestParts<S>>
and $N others
and 28 others
= note: required for `bool` to implement `FromRequest<(), axum_core::extract::private::ViaParts>`
note: required by a bound in `__axum_macros_check_handler_0_from_request_check`
--> tests/debug_handler/fail/argument_not_extractor.rs:5:24

View file

@ -13,7 +13,7 @@ error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is
i32
i64
i128
and $N others
and 131 others
= note: required for `Struct` to implement `serde::de::DeserializeOwned`
= note: required for `Json<Struct>` to implement `FromRequest<()>`
= help: see issue #48214

View file

@ -10,10 +10,10 @@ error[E0277]: the trait bound `NotIntoResponse: IntoResponse` is not satisfied
axum::body::Bytes
Body
axum::extract::rejection::FailedToBufferBody
bytes::bytes_mut::BytesMut
axum::extract::rejection::LengthLimitError
axum::extract::rejection::UnknownBodyError
bytes::bytes_mut::BytesMut
and $N others
and 121 others
note: required by a bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
--> tests/debug_handler/fail/single_wrong_return_tuple.rs:6:23
|

View file

@ -19,6 +19,6 @@ error[E0277]: the trait bound `CustomIntoResponse: IntoResponseParts` is not sat
[(K, V); N]
()
(T1,)
and $N others
and 15 others
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

View file

@ -10,10 +10,10 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
axum::body::Bytes
Body
axum::extract::rejection::FailedToBufferBody
bytes::bytes_mut::BytesMut
axum::extract::rejection::LengthLimitError
axum::extract::rejection::UnknownBodyError
bytes::bytes_mut::BytesMut
and $N others
and 121 others
note: required by a bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
--> tests/debug_handler/fail/wrong_return_type.rs:4:23
|

View file

@ -15,4 +15,4 @@ error[E0277]: the trait bound `String: FromRequestParts<S>` is not satisfied
<Uri as FromRequestParts<S>>
<Version as FromRequestParts<S>>
<Extensions as FromRequestParts<S>>
and $N others
and 29 others

View file

@ -13,7 +13,27 @@ error[E0277]: the trait bound `for<'de> MyPath: serde::de::Deserialize<'de>` is
i32
i64
i128
and $N others
and 131 others
= note: required for `MyPath` to implement `serde::de::DeserializeOwned`
= note: required for `axum::extract::Path<MyPath>` to implement `FromRequestParts<S>`
= note: this error originates in the derive macro `TypedPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `for<'de> MyPath: serde::de::Deserialize<'de>` is not satisfied
--> tests/typed_path/fail/not_deserialize.rs:3:10
|
3 | #[derive(TypedPath)]
| ^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `MyPath`
|
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
bool
char
isize
i8
i16
i32
i64
i128
and 131 others
= note: required for `MyPath` to implement `serde::de::DeserializeOwned`
= note: required for `axum::extract::Path<MyPath>` to implement `FromRequestParts<S>`
= note: this error originates in the derive macro `TypedPath` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -1,5 +1,5 @@
use axum_extra::routing::{TypedPath, RouterExt};
use axum::{extract::rejection::PathRejection, http::StatusCode};
use axum_extra::routing::{RouterExt, TypedPath};
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
@ -8,8 +8,6 @@ struct UsersShow {
id: String,
}
async fn option_handler(_: Option<UsersShow>) {}
async fn result_handler(_: Result<UsersShow, PathRejection>) {}
#[derive(TypedPath, Deserialize)]
@ -20,7 +18,6 @@ async fn result_handler_unit_struct(_: Result<UsersIndex, StatusCode>) {}
fn main() {
_ = axum::Router::<()>::new()
.typed_get(option_handler)
.typed_post(result_handler)
.typed_post(result_handler_unit_struct);
}