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::{routing::get, Router};
use axum_macros::FromRequest;
@@ -1,13 +1,13 @@
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
--> 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}`
| |
| required by a bound introduced by this call
@@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum::{routing::get, Router};
use axum_macros::FromRequest;
@@ -1,13 +1,13 @@
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
--> 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}`
| |
| required by a bound introduced by this call
@@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum::{
extract::rejection::ExtensionRejection,
response::{IntoResponse, Response},
@@ -1,13 +1,13 @@
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
--> 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}`
| |
| 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)
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}`
| |
| required by a bound introduced by this call
@@ -1,4 +1,3 @@
#![feature(diagnostic_namespace)]
use axum::{extract::FromRequestParts, response::Response};
#[derive(FromRequestParts)]
@@ -1,7 +1,7 @@
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`
|
= note: Function argument is not a valid axum extractor.