Make nightly_error_messages feature compatible with latest nightly

This commit is contained in:
David Mládek
2024-03-14 21:19:03 +01:00
committed by GitHub
parent b6b203b306
commit 3569950a2e
18 changed files with 86 additions and 58 deletions
@@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum_macros::debug_handler;
#[debug_handler]
@@ -1,24 +1,24 @@
error[E0277]: the trait bound `bool: FromRequestParts<()>` is not satisfied
--> tests/debug_handler/fail/argument_not_extractor.rs:5:24
error[E0277]: the trait bound `bool: FromRequest<(), axum_core::extract::private::ViaParts>` is not satisfied
--> tests/debug_handler/fail/argument_not_extractor.rs:4:24
|
5 | async fn handler(_foo: bool) {}
| ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool`
4 | async fn handler(_foo: bool) {}
| ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool`, which is required by `bool: FromRequest<(), _>`
|
= note: Function argument is not a valid axum extractor.
See `https://docs.rs/axum/0.7/axum/extract/index.html` for details
= help: the following other types implement trait `FromRequestParts<S>`:
<HeaderMap as FromRequestParts<S>>
<Extension<T> as FromRequestParts<S>>
<Method as FromRequestParts<S>>
<axum::http::request::Parts as FromRequestParts<S>>
<Uri as FromRequestParts<S>>
<Version as FromRequestParts<S>>
<Extensions as FromRequestParts<S>>
<ConnectInfo<T> as FromRequestParts<S>>
= help: the following other types implement trait `FromRequest<S, M>`:
axum::body::Bytes
Body
Form<T>
Json<T>
axum::http::Request<Body>
RawForm
String
Option<T>
and $N 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
--> tests/debug_handler/fail/argument_not_extractor.rs:4:24
|
5 | async fn handler(_foo: bool) {}
4 | async fn handler(_foo: bool) {}
| ^^^^ required by this bound in `__axum_macros_check_handler_0_from_request_check`
@@ -4,6 +4,6 @@ use axum_macros::debug_handler;
struct Struct {}
#[debug_handler]
async fn handler(foo: Json<Struct>) {}
async fn handler(_foo: Json<Struct>) {}
fn main() {}
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is not satisfied
--> tests/debug_handler/fail/json_not_deserialize.rs:7:23
--> tests/debug_handler/fail/json_not_deserialize.rs:7:24
|
7 | async fn handler(foo: Json<Struct>) {}
| ^^^^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `Struct`
7 | async fn handler(_foo: Json<Struct>) {}
| ^^^^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `Struct`, which is required by `Json<Struct>: FromRequest<()>`
|
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
bool
@@ -18,3 +18,27 @@ error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is
= note: required for `Json<Struct>` to implement `FromRequest<()>`
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is not satisfied
--> tests/debug_handler/fail/json_not_deserialize.rs:7:24
|
7 | async fn handler(_foo: Json<Struct>) {}
| ^^^^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `Struct`, which is required by `Json<Struct>: FromRequest<()>`
|
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
bool
char
isize
i8
i16
i32
i64
i128
and $N others
= note: required for `Struct` to implement `serde::de::DeserializeOwned`
= note: required for `Json<Struct>` to implement `FromRequest<()>`
note: required by a bound in `__axum_macros_check_handler_0_from_request_check`
--> tests/debug_handler/fail/json_not_deserialize.rs:7:24
|
7 | async fn handler(_foo: Json<Struct>) {}
| ^^^^^^^^^^^^ required by this bound in `__axum_macros_check_handler_0_from_request_check`
@@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
3 | #[debug_handler]
| ^^^^^^^^^^^^^^^^ future returned by `handler` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
note: future is not `Send` as this value is used across an await
--> tests/debug_handler/fail/not_send.rs:6:14
|
@@ -12,8 +12,6 @@ note: future is not `Send` as this value is used across an await
| --- has type `Rc<()>` which is not `Send`
6 | async {}.await;
| ^^^^^ await occurs here, with `_rc` maybe used later
7 | }
| - `_rc` is later dropped here
note: required by a bound in `check`
--> tests/debug_handler/fail/not_send.rs:3:1
|
@@ -22,3 +22,25 @@ error[E0277]: the trait bound `CustomIntoResponse: IntoResponseParts` is not sat
and $N others
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `CustomIntoResponse: IntoResponseParts` is not satisfied
--> tests/debug_handler/fail/wrong_return_tuple.rs:24:5
|
24 | CustomIntoResponse,
| ^^^^^^^^^^^^^^^^^^ the trait `IntoResponseParts` is not implemented for `CustomIntoResponse`
|
= help: the following other types implement trait `IntoResponseParts`:
AppendHeaders<I>
HeaderMap
Extension<T>
Extensions
Option<T>
[(K, V); N]
()
(T1,)
and $N others
note: required by a bound in `__axum_macros_check_custom_type_into_response_parts_1_check`
--> tests/debug_handler/fail/wrong_return_tuple.rs:24:5
|
24 | CustomIntoResponse,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `__axum_macros_check_custom_type_into_response_parts_1_check`