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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 86 additions and 58 deletions

View File

@ -1,4 +1,3 @@
#![cfg_attr(nightly_error_messages, feature(diagnostic_namespace))]
//! Core types and traits for [`axum`]. //! Core types and traits for [`axum`].
//! //!
//! Libraries authors that want to provide [`FromRequest`] or [`IntoResponse`] implementations //! Libraries authors that want to provide [`FromRequest`] or [`IntoResponse`] implementations

View File

@ -1 +1 @@
nightly-2023-09-23 nightly-2024-03-13

View File

@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum_macros::debug_handler; use axum_macros::debug_handler;
#[debug_handler] #[debug_handler]

View File

@ -1,24 +1,24 @@
error[E0277]: the trait bound `bool: FromRequestParts<()>` is not satisfied error[E0277]: the trait bound `bool: FromRequest<(), axum_core::extract::private::ViaParts>` is not satisfied
--> 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) {}
| ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool` | ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool`, which is required by `bool: FromRequest<(), _>`
| |
= note: Function argument is not a valid axum extractor. = note: Function argument is not a valid axum extractor.
See `https://docs.rs/axum/0.7/axum/extract/index.html` for details See `https://docs.rs/axum/0.7/axum/extract/index.html` for details
= help: the following other types implement trait `FromRequestParts<S>`: = help: the following other types implement trait `FromRequest<S, M>`:
<HeaderMap as FromRequestParts<S>> axum::body::Bytes
<Extension<T> as FromRequestParts<S>> Body
<Method as FromRequestParts<S>> Form<T>
<axum::http::request::Parts as FromRequestParts<S>> Json<T>
<Uri as FromRequestParts<S>> axum::http::Request<Body>
<Version as FromRequestParts<S>> RawForm
<Extensions as FromRequestParts<S>> String
<ConnectInfo<T> as FromRequestParts<S>> Option<T>
and $N others and $N others
= note: required for `bool` to implement `FromRequest<(), axum_core::extract::private::ViaParts>` = 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` 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` | ^^^^ required by this bound in `__axum_macros_check_handler_0_from_request_check`

View File

@ -4,6 +4,6 @@ use axum_macros::debug_handler;
struct Struct {} struct Struct {}
#[debug_handler] #[debug_handler]
async fn handler(foo: Json<Struct>) {} async fn handler(_foo: Json<Struct>) {}
fn main() {} fn main() {}

View File

@ -1,8 +1,8 @@
error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is not satisfied 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>) {} 7 | async fn handler(_foo: Json<Struct>) {}
| ^^^^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `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>`: = help: the following other types implement trait `serde::de::Deserialize<'de>`:
bool 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<()>` = note: required for `Json<Struct>` to implement `FromRequest<()>`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = 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`

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
3 | #[debug_handler] 3 | #[debug_handler]
| ^^^^^^^^^^^^^^^^ future returned by `handler` is not `Send` | ^^^^^^^^^^^^^^^^ 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 note: future is not `Send` as this value is used across an await
--> tests/debug_handler/fail/not_send.rs:6:14 --> 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` | --- has type `Rc<()>` which is not `Send`
6 | async {}.await; 6 | async {}.await;
| ^^^^^ await occurs here, with `_rc` maybe used later | ^^^^^ await occurs here, with `_rc` maybe used later
7 | }
| - `_rc` is later dropped here
note: required by a bound in `check` note: required by a bound in `check`
--> tests/debug_handler/fail/not_send.rs:3:1 --> tests/debug_handler/fail/not_send.rs:3:1
| |

View File

@ -22,3 +22,25 @@ error[E0277]: the trait bound `CustomIntoResponse: IntoResponseParts` is not sat
and $N others and $N others
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = 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`

View File

@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum::{routing::get, Router}; use axum::{routing::get, Router};
use axum_macros::FromRequest; use axum_macros::FromRequest;

View File

@ -1,13 +1,13 @@
error: #[derive(FromRequest)] only supports generics when used with #[from_request(via)] error: #[derive(FromRequest)] only supports generics when used with #[from_request(via)]
--> tests/from_request/fail/generic_without_via.rs:6:18 --> tests/from_request/fail/generic_without_via.rs:5:18
| |
6 | struct Extractor<T>(T); 5 | struct Extractor<T>(T);
| ^ | ^
error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future<Output = ()> {foo}: Handler<_, _>` is not satisfied error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future<Output = ()> {foo}: Handler<_, _>` is not satisfied
--> tests/from_request/fail/generic_without_via.rs:11:44 --> tests/from_request/fail/generic_without_via.rs:10:44
| |
11 | _ = Router::<()>::new().route("/", get(foo)); 10 | _ = Router::<()>::new().route("/", get(foo));
| --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}` | --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call

View File

@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum::{routing::get, Router}; use axum::{routing::get, Router};
use axum_macros::FromRequest; use axum_macros::FromRequest;

View File

@ -1,13 +1,13 @@
error: #[derive(FromRequest)] only supports generics when used with #[from_request(via)] error: #[derive(FromRequest)] only supports generics when used with #[from_request(via)]
--> tests/from_request/fail/generic_without_via_rejection.rs:7:18 --> tests/from_request/fail/generic_without_via_rejection.rs:6:18
| |
7 | struct Extractor<T>(T); 6 | struct Extractor<T>(T);
| ^ | ^
error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future<Output = ()> {foo}: Handler<_, _>` is not satisfied error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future<Output = ()> {foo}: Handler<_, _>` is not satisfied
--> tests/from_request/fail/generic_without_via_rejection.rs:12:44 --> tests/from_request/fail/generic_without_via_rejection.rs:11:44
| |
12 | _ = Router::<()>::new().route("/", get(foo)); 11 | _ = Router::<()>::new().route("/", get(foo));
| --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}` | --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call

View File

@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum::{ use axum::{
extract::rejection::ExtensionRejection, extract::rejection::ExtensionRejection,
response::{IntoResponse, Response}, response::{IntoResponse, Response},

View File

@ -1,13 +1,13 @@
error: cannot use `rejection` without `via` error: cannot use `rejection` without `via`
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:19:16 --> tests/from_request/fail/override_rejection_on_enum_without_via.rs:18:16
| |
19 | #[from_request(rejection(MyRejection))] 18 | #[from_request(rejection(MyRejection))]
| ^^^^^^^^^ | ^^^^^^^^^
error[E0277]: the trait bound `fn(MyExtractor) -> impl Future<Output = ()> {handler}: Handler<_, _>` is not satisfied error[E0277]: the trait bound `fn(MyExtractor) -> impl Future<Output = ()> {handler}: Handler<_, _>` is not satisfied
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:50 --> tests/from_request/fail/override_rejection_on_enum_without_via.rs:10:50
| |
11 | let _: Router = Router::new().route("/", get(handler).post(handler_result)); 10 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
| --- ^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(MyExtractor) -> impl Future<Output = ()> {handler}` | --- ^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(MyExtractor) -> impl Future<Output = ()> {handler}`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
@ -27,9 +27,9 @@ note: required by a bound in `axum::routing::get`
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `fn(Result<MyExtractor, MyRejection>) -> impl Future<Output = ()> {handler_result}: Handler<_, _>` is not satisfied error[E0277]: the trait bound `fn(Result<MyExtractor, MyRejection>) -> impl Future<Output = ()> {handler_result}: Handler<_, _>` is not satisfied
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:64 --> tests/from_request/fail/override_rejection_on_enum_without_via.rs:10:64
| |
11 | let _: Router = Router::new().route("/", get(handler).post(handler_result)); 10 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
| ---- ^^^^^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Result<MyExtractor, MyRejection>) -> impl Future<Output = ()> {handler_result}` | ---- ^^^^^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Result<MyExtractor, MyRejection>) -> impl Future<Output = ()> {handler_result}`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call

View File

@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum::{extract::FromRequestParts, response::Response}; use axum::{extract::FromRequestParts, response::Response};
#[derive(FromRequestParts)] #[derive(FromRequestParts)]

View File

@ -1,7 +1,7 @@
error[E0277]: the trait bound `String: FromRequestParts<S>` is not satisfied error[E0277]: the trait bound `String: FromRequestParts<S>` is not satisfied
--> tests/from_request/fail/parts_extracting_body.rs:6:11 --> tests/from_request/fail/parts_extracting_body.rs:5:11
| |
6 | body: String, 5 | body: String,
| ^^^^^^ the trait `FromRequestParts<S>` is not implemented for `String` | ^^^^^^ the trait `FromRequestParts<S>` is not implemented for `String`
| |
= note: Function argument is not a valid axum extractor. = note: Function argument is not a valid axum extractor.

View File

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

View File

@ -1,4 +1,3 @@
#![cfg_attr(nightly_error_messages, feature(diagnostic_namespace))]
//! axum is a web application framework that focuses on ergonomics and modularity. //! axum is a web application framework that focuses on ergonomics and modularity.
//! //!
//! # Table of contents //! # Table of contents