mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-25 00:28:07 +01:00
Use the diagnostic namespace (#2246)
This commit is contained in:
parent
930e2ab7c1
commit
2f6200dfbd
26 changed files with 126 additions and 109 deletions
|
@ -45,7 +45,7 @@ mod private {
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
nightly_error_messages,
|
nightly_error_messages,
|
||||||
rustc_on_unimplemented(
|
diagnostic::on_unimplemented(
|
||||||
note = "Function argument is not a valid axum extractor. \nSee `https://docs.rs/axum/latest/axum/extract/index.html` for details",
|
note = "Function argument is not a valid axum extractor. \nSee `https://docs.rs/axum/latest/axum/extract/index.html` for details",
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
@ -72,7 +72,7 @@ pub trait FromRequestParts<S>: Sized {
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
nightly_error_messages,
|
nightly_error_messages,
|
||||||
rustc_on_unimplemented(
|
diagnostic::on_unimplemented(
|
||||||
note = "Function argument is not a valid axum extractor. \nSee `https://docs.rs/axum/latest/axum/extract/index.html` for details",
|
note = "Function argument is not a valid axum extractor. \nSee `https://docs.rs/axum/latest/axum/extract/index.html` for details",
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#![cfg_attr(nightly_error_messages, allow(internal_features), feature(rustc_attrs))]
|
#![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
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
missing_debug_implementations,
|
missing_debug_implementations,
|
||||||
missing_docs
|
missing_docs
|
||||||
)]
|
)]
|
||||||
#![deny(unreachable_pub, private_in_public)]
|
#![deny(unreachable_pub)]
|
||||||
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![cfg_attr(test, allow(clippy::float_cmp))]
|
#![cfg_attr(test, allow(clippy::float_cmp))]
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
missing_debug_implementations,
|
missing_debug_implementations,
|
||||||
missing_docs
|
missing_docs
|
||||||
)]
|
)]
|
||||||
#![deny(unreachable_pub, private_in_public)]
|
#![deny(unreachable_pub)]
|
||||||
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
nightly-2023-04-06
|
nightly-2023-09-23
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
missing_debug_implementations,
|
missing_debug_implementations,
|
||||||
missing_docs
|
missing_docs
|
||||||
)]
|
)]
|
||||||
#![deny(unreachable_pub, private_in_public)]
|
#![deny(unreachable_pub)]
|
||||||
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
#![feature(diagnostic_namespace)]
|
||||||
use axum_macros::debug_handler;
|
use axum_macros::debug_handler;
|
||||||
|
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
async fn handler(foo: bool) {}
|
async fn handler(_foo: bool) {}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
error[E0277]: the trait bound `bool: FromRequestParts<()>` is not satisfied
|
error[E0277]: the trait bound `bool: FromRequestParts<()>` is not satisfied
|
||||||
--> tests/debug_handler/fail/argument_not_extractor.rs:4:23
|
--> tests/debug_handler/fail/argument_not_extractor.rs:5:24
|
||||||
|
|
|
|
||||||
4 | async fn handler(foo: bool) {}
|
5 | async fn handler(_foo: bool) {}
|
||||||
| ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool`
|
| ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool`
|
||||||
|
|
|
|
||||||
= note: Function argument is not a valid axum extractor.
|
= note: Function argument is not a valid axum extractor.
|
||||||
See `https://docs.rs/axum/latest/axum/extract/index.html` for details
|
See `https://docs.rs/axum/latest/axum/extract/index.html` for details
|
||||||
= help: the following other types implement trait `FromRequestParts<S>`:
|
= help: the following other types implement trait `FromRequestParts<S>`:
|
||||||
<() as FromRequestParts<S>>
|
<HeaderMap as FromRequestParts<S>>
|
||||||
<(T1, T2) as FromRequestParts<S>>
|
<Extension<T> as FromRequestParts<S>>
|
||||||
<(T1, T2, T3) as FromRequestParts<S>>
|
<Method as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4) as FromRequestParts<S>>
|
<Uri as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5) as FromRequestParts<S>>
|
<Version as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5, T6) as FromRequestParts<S>>
|
<ConnectInfo<T> as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5, T6, T7) as FromRequestParts<S>>
|
<axum::extract::Path<T> as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5, T6, T7, T8) as FromRequestParts<S>>
|
<RawPathParams as FromRequestParts<S>>
|
||||||
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:4:23
|
--> tests/debug_handler/fail/argument_not_extractor.rs:5:24
|
||||||
|
|
|
|
||||||
4 | async fn handler(foo: bool) {}
|
5 | 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`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use axum_macros::debug_handler;
|
use axum_macros::debug_handler;
|
||||||
|
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
async fn handler<T>(extract: T) {}
|
async fn handler<T>(_extract: T) {}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error: `#[axum_macros::debug_handler]` doesn't support generic functions
|
error: `#[axum_macros::debug_handler]` doesn't support generic functions
|
||||||
--> tests/debug_handler/fail/generics.rs:4:17
|
--> tests/debug_handler/fail/generics.rs:4:17
|
||||||
|
|
|
|
||||||
4 | async fn handler<T>(extract: T) {}
|
4 | async fn handler<T>(_extract: T) {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
@ -5,14 +5,14 @@ error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is
|
||||||
| ^^^^^^^^^^^^ 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`
|
||||||
|
|
|
|
||||||
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
|
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
|
||||||
&'a [u8]
|
bool
|
||||||
&'a serde_json::raw::RawValue
|
char
|
||||||
&'a std::path::Path
|
isize
|
||||||
&'a str
|
i8
|
||||||
()
|
i16
|
||||||
(T0, T1)
|
i32
|
||||||
(T0, T1, T2)
|
i64
|
||||||
(T0, T1, T2, T3)
|
i128
|
||||||
and $N others
|
and $N others
|
||||||
= note: required for `Struct` to implement `serde::de::DeserializeOwned`
|
= note: required for `Struct` to implement `serde::de::DeserializeOwned`
|
||||||
= note: required for `Json<Struct>` to implement `FromRequest<()>`
|
= note: required for `Json<Struct>` to implement `FromRequest<()>`
|
||||||
|
|
|
@ -2,7 +2,7 @@ use axum_macros::debug_handler;
|
||||||
|
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
async fn handler() {
|
async fn handler() {
|
||||||
let rc = std::rc::Rc::new(());
|
let _rc = std::rc::Rc::new(());
|
||||||
async {}.await;
|
async {}.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,14 @@ error: future cannot be sent between threads safely
|
||||||
|
|
|
|
||||||
= 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<()>`
|
||||||
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:13
|
--> tests/debug_handler/fail/not_send.rs:6:14
|
||||||
|
|
|
|
||||||
5 | let rc = std::rc::Rc::new(());
|
5 | let _rc = std::rc::Rc::new(());
|
||||||
| -- 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 | }
|
7 | }
|
||||||
| - `rc` is later dropped here
|
| - `_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
|
||||||
|
|
|
|
||||||
|
|
|
@ -3,23 +3,23 @@ use axum::http::Uri;
|
||||||
|
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
async fn handler(
|
async fn handler(
|
||||||
e1: Uri,
|
_e1: Uri,
|
||||||
e2: Uri,
|
_e2: Uri,
|
||||||
e3: Uri,
|
_e3: Uri,
|
||||||
e4: Uri,
|
_e4: Uri,
|
||||||
e5: Uri,
|
_e5: Uri,
|
||||||
e6: Uri,
|
_e6: Uri,
|
||||||
e7: Uri,
|
_e7: Uri,
|
||||||
e8: Uri,
|
_e8: Uri,
|
||||||
e9: Uri,
|
_e9: Uri,
|
||||||
e10: Uri,
|
_e10: Uri,
|
||||||
e11: Uri,
|
_e11: Uri,
|
||||||
e12: Uri,
|
_e12: Uri,
|
||||||
e13: Uri,
|
_e13: Uri,
|
||||||
e14: Uri,
|
_e14: Uri,
|
||||||
e15: Uri,
|
_e15: Uri,
|
||||||
e16: Uri,
|
_e16: Uri,
|
||||||
e17: Uri,
|
_e17: Uri,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error: Handlers cannot take more than 16 arguments. Use `(a, b): (ExtractorA, ExtractorA)` to further nest extractors
|
error: Handlers cannot take more than 16 arguments. Use `(a, b): (ExtractorA, ExtractorA)` to further nest extractors
|
||||||
--> tests/debug_handler/fail/too_many_extractors.rs:6:5
|
--> tests/debug_handler/fail/too_many_extractors.rs:6:5
|
||||||
|
|
|
|
||||||
6 | / e1: Uri,
|
6 | / _e1: Uri,
|
||||||
7 | | e2: Uri,
|
7 | | _e2: Uri,
|
||||||
8 | | e3: Uri,
|
8 | | _e3: Uri,
|
||||||
9 | | e4: Uri,
|
9 | | _e4: Uri,
|
||||||
... |
|
... |
|
||||||
21 | | e16: Uri,
|
21 | | _e16: Uri,
|
||||||
22 | | e17: Uri,
|
22 | | _e17: Uri,
|
||||||
| |_____________^
|
| |______________^
|
||||||
|
|
|
@ -5,14 +5,14 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
|
||||||
| ^^^^ the trait `IntoResponse` is not implemented for `bool`
|
| ^^^^ the trait `IntoResponse` is not implemented for `bool`
|
||||||
|
|
|
|
||||||
= help: the following other types implement trait `IntoResponse`:
|
= help: the following other types implement trait `IntoResponse`:
|
||||||
&'static [u8; N]
|
Box<str>
|
||||||
&'static [u8]
|
Box<[u8]>
|
||||||
&'static str
|
axum::body::Bytes
|
||||||
()
|
Body
|
||||||
(R,)
|
axum::extract::rejection::FailedToBufferBody
|
||||||
(Response<()>, R)
|
axum::extract::rejection::LengthLimitError
|
||||||
(Response<()>, T1, R)
|
axum::extract::rejection::UnknownBodyError
|
||||||
(Response<()>, T1, T2, R)
|
axum::extract::rejection::InvalidUtf8
|
||||||
and $N others
|
and $N others
|
||||||
note: required by a bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
|
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
|
--> tests/debug_handler/fail/wrong_return_type.rs:4:23
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![feature(diagnostic_namespace)]
|
||||||
use axum::{routing::get, Router};
|
use axum::{routing::get, Router};
|
||||||
use axum_macros::FromRequest;
|
use axum_macros::FromRequest;
|
||||||
|
|
||||||
|
|
|
@ -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:5:18
|
--> tests/from_request/fail/generic_without_via.rs:6:18
|
||||||
|
|
|
|
||||||
5 | 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.rs:10:44
|
--> tests/from_request/fail/generic_without_via.rs:11:44
|
||||||
|
|
|
|
||||||
10 | _ = 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
|
||||||
|
@ -20,5 +20,8 @@ note: required by a bound in `axum::routing::get`
|
||||||
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
||||||
|
|
|
|
||||||
| top_level_handler_fn!(get, GET);
|
| top_level_handler_fn!(get, GET);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get`
|
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
|
||||||
|
| | |
|
||||||
|
| | required by a bound in this function
|
||||||
|
| required by this bound in `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)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![feature(diagnostic_namespace)]
|
||||||
use axum::{routing::get, Router};
|
use axum::{routing::get, Router};
|
||||||
use axum_macros::FromRequest;
|
use axum_macros::FromRequest;
|
||||||
|
|
||||||
|
|
|
@ -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:6:18
|
--> tests/from_request/fail/generic_without_via_rejection.rs:7:18
|
||||||
|
|
|
|
||||||
6 | struct Extractor<T>(T);
|
7 | 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:11:44
|
--> tests/from_request/fail/generic_without_via_rejection.rs:12:44
|
||||||
|
|
|
|
||||||
11 | _ = Router::<()>::new().route("/", get(foo));
|
12 | _ = 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
|
||||||
|
@ -20,5 +20,8 @@ note: required by a bound in `axum::routing::get`
|
||||||
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
||||||
|
|
|
|
||||||
| top_level_handler_fn!(get, GET);
|
| top_level_handler_fn!(get, GET);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get`
|
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
|
||||||
|
| | |
|
||||||
|
| | required by a bound in this function
|
||||||
|
| required by this bound in `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)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![feature(diagnostic_namespace)]
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::rejection::ExtensionRejection,
|
extract::rejection::ExtensionRejection,
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
|
|
|
@ -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:18:16
|
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:19:16
|
||||||
|
|
|
|
||||||
18 | #[from_request(rejection(MyRejection))]
|
19 | #[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:10:50
|
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:50
|
||||||
|
|
|
|
||||||
10 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
|
11 | 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
|
||||||
|
@ -20,13 +20,16 @@ note: required by a bound in `axum::routing::get`
|
||||||
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
||||||
|
|
|
|
||||||
| top_level_handler_fn!(get, GET);
|
| top_level_handler_fn!(get, GET);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get`
|
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
|
||||||
|
| | |
|
||||||
|
| | required by a bound in this function
|
||||||
|
| required by this bound in `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:10:64
|
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:64
|
||||||
|
|
|
|
||||||
10 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
|
11 | 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
|
||||||
|
@ -39,5 +42,8 @@ note: required by a bound in `MethodRouter::<S>::post`
|
||||||
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
--> $WORKSPACE/axum/src/routing/method_routing.rs
|
||||||
|
|
|
|
||||||
| chained_handler_fn!(post, POST);
|
| chained_handler_fn!(post, POST);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MethodRouter::<S>::post`
|
| ^^^^^^^^^^^^^^^^^^^^----^^^^^^^
|
||||||
|
| | |
|
||||||
|
| | required by a bound in this associated function
|
||||||
|
| required by this bound in `MethodRouter::<S>::post`
|
||||||
= note: this error originates in the macro `chained_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the macro `chained_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![feature(diagnostic_namespace)]
|
||||||
use axum::{extract::FromRequestParts, response::Response};
|
use axum::{extract::FromRequestParts, response::Response};
|
||||||
|
|
||||||
#[derive(FromRequestParts)]
|
#[derive(FromRequestParts)]
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
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:5:11
|
--> tests/from_request/fail/parts_extracting_body.rs:6:11
|
||||||
|
|
|
|
||||||
5 | body: String,
|
6 | 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.
|
||||||
See `https://docs.rs/axum/latest/axum/extract/index.html` for details
|
See `https://docs.rs/axum/latest/axum/extract/index.html` for details
|
||||||
= help: the following other types implement trait `FromRequestParts<S>`:
|
= help: the following other types implement trait `FromRequestParts<S>`:
|
||||||
<() as FromRequestParts<S>>
|
<Extractor as FromRequestParts<S>>
|
||||||
<(T1, T2) as FromRequestParts<S>>
|
<HeaderMap as FromRequestParts<S>>
|
||||||
<(T1, T2, T3) as FromRequestParts<S>>
|
<Extension<T> as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4) as FromRequestParts<S>>
|
<Method as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5) as FromRequestParts<S>>
|
<Uri as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5, T6) as FromRequestParts<S>>
|
<Version as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5, T6, T7) as FromRequestParts<S>>
|
<ConnectInfo<T> as FromRequestParts<S>>
|
||||||
<(T1, T2, T3, T4, T5, T6, T7, T8) as FromRequestParts<S>>
|
<axum::extract::Path<T> as FromRequestParts<S>>
|
||||||
and $N others
|
and $N others
|
||||||
|
|
|
@ -5,14 +5,14 @@ error[E0277]: the trait bound `for<'de> MyPath: serde::de::Deserialize<'de>` is
|
||||||
| ^^^^^^^^^ 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`
|
||||||
|
|
|
|
||||||
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
|
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
|
||||||
&'a [u8]
|
bool
|
||||||
&'a serde_json::raw::RawValue
|
char
|
||||||
&'a std::path::Path
|
isize
|
||||||
&'a str
|
i8
|
||||||
()
|
i16
|
||||||
(T0, T1)
|
i32
|
||||||
(T0, T1, T2)
|
i64
|
||||||
(T0, T1, T2, T3)
|
i128
|
||||||
and $N others
|
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>`
|
||||||
|
|
|
@ -127,7 +127,7 @@ pub use self::service::HandlerService;
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
nightly_error_messages,
|
nightly_error_messages,
|
||||||
rustc_on_unimplemented(
|
diagnostic::on_unimplemented(
|
||||||
note = "Consider using `#[axum::debug_handler]` to improve the error message"
|
note = "Consider using `#[axum::debug_handler]` to improve the error message"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#![cfg_attr(nightly_error_messages, allow(internal_features), feature(rustc_attrs))]
|
#![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
|
||||||
|
@ -416,7 +416,7 @@
|
||||||
missing_debug_implementations,
|
missing_debug_implementations,
|
||||||
missing_docs
|
missing_docs
|
||||||
)]
|
)]
|
||||||
#![deny(unreachable_pub, private_in_public)]
|
#![deny(unreachable_pub)]
|
||||||
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
|
||||||
// can't be `forbid` since we've vendored code from hyper-util that contains `unsafe`
|
// can't be `forbid` since we've vendored code from hyper-util that contains `unsafe`
|
||||||
// when hyper-util is on crates.io we can stop vendoring it and go back to `forbid`
|
// when hyper-util is on crates.io we can stop vendoring it and go back to `forbid`
|
||||||
|
|
Loading…
Reference in a new issue