From 2f6200dfbde7d3944c7785d873ecbe6b7c402483 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Fri, 29 Sep 2023 07:25:26 +0000 Subject: [PATCH] Use the diagnostic namespace (#2246) --- axum-core/src/extract/mod.rs | 4 +-- axum-core/src/lib.rs | 4 +-- axum-extra/src/lib.rs | 2 +- axum-macros/rust-toolchain | 2 +- axum-macros/src/lib.rs | 2 +- .../fail/argument_not_extractor.rs | 3 +- .../fail/argument_not_extractor.stderr | 28 +++++++-------- .../tests/debug_handler/fail/generics.rs | 2 +- .../tests/debug_handler/fail/generics.stderr | 2 +- .../fail/json_not_deserialize.stderr | 16 ++++----- .../tests/debug_handler/fail/not_send.rs | 2 +- .../tests/debug_handler/fail/not_send.stderr | 10 +++--- .../debug_handler/fail/too_many_extractors.rs | 34 +++++++++---------- .../fail/too_many_extractors.stderr | 14 ++++---- .../fail/wrong_return_type.stderr | 16 ++++----- .../from_request/fail/generic_without_via.rs | 1 + .../fail/generic_without_via.stderr | 13 ++++--- .../fail/generic_without_via_rejection.rs | 1 + .../fail/generic_without_via_rejection.stderr | 13 ++++--- .../override_rejection_on_enum_without_via.rs | 1 + ...rride_rejection_on_enum_without_via.stderr | 22 +++++++----- .../fail/parts_extracting_body.rs | 1 + .../fail/parts_extracting_body.stderr | 20 +++++------ .../typed_path/fail/not_deserialize.stderr | 16 ++++----- axum/src/handler/mod.rs | 2 +- axum/src/lib.rs | 4 +-- 26 files changed, 126 insertions(+), 109 deletions(-) diff --git a/axum-core/src/extract/mod.rs b/axum-core/src/extract/mod.rs index 758e5a52..38e01fbf 100644 --- a/axum-core/src/extract/mod.rs +++ b/axum-core/src/extract/mod.rs @@ -45,7 +45,7 @@ mod private { #[async_trait] #[cfg_attr( 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", ) )] @@ -72,7 +72,7 @@ pub trait FromRequestParts: Sized { #[async_trait] #[cfg_attr( 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", ) )] diff --git a/axum-core/src/lib.rs b/axum-core/src/lib.rs index 5d4b27a4..a4dd6cd9 100644 --- a/axum-core/src/lib.rs +++ b/axum-core/src/lib.rs @@ -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`]. //! //! Libraries authors that want to provide [`FromRequest`] or [`IntoResponse`] implementations @@ -44,7 +44,7 @@ missing_debug_implementations, missing_docs )] -#![deny(unreachable_pub, private_in_public)] +#![deny(unreachable_pub)] #![allow(elided_lifetimes_in_paths, clippy::type_complexity)] #![forbid(unsafe_code)] #![cfg_attr(test, allow(clippy::float_cmp))] diff --git a/axum-extra/src/lib.rs b/axum-extra/src/lib.rs index e6f9e879..b087980c 100644 --- a/axum-extra/src/lib.rs +++ b/axum-extra/src/lib.rs @@ -60,7 +60,7 @@ missing_debug_implementations, missing_docs )] -#![deny(unreachable_pub, private_in_public)] +#![deny(unreachable_pub)] #![allow(elided_lifetimes_in_paths, clippy::type_complexity)] #![forbid(unsafe_code)] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] diff --git a/axum-macros/rust-toolchain b/axum-macros/rust-toolchain index a1eb1fc7..2c3dbd2c 100644 --- a/axum-macros/rust-toolchain +++ b/axum-macros/rust-toolchain @@ -1 +1 @@ -nightly-2023-04-06 +nightly-2023-09-23 diff --git a/axum-macros/src/lib.rs b/axum-macros/src/lib.rs index e83ff75c..2d537044 100644 --- a/axum-macros/src/lib.rs +++ b/axum-macros/src/lib.rs @@ -37,7 +37,7 @@ missing_debug_implementations, missing_docs )] -#![deny(unreachable_pub, private_in_public)] +#![deny(unreachable_pub)] #![allow(elided_lifetimes_in_paths, clippy::type_complexity)] #![forbid(unsafe_code)] #![cfg_attr(docsrs, feature(doc_cfg))] diff --git a/axum-macros/tests/debug_handler/fail/argument_not_extractor.rs b/axum-macros/tests/debug_handler/fail/argument_not_extractor.rs index afa9a72a..2d386c82 100644 --- a/axum-macros/tests/debug_handler/fail/argument_not_extractor.rs +++ b/axum-macros/tests/debug_handler/fail/argument_not_extractor.rs @@ -1,6 +1,7 @@ +#![feature(diagnostic_namespace)] use axum_macros::debug_handler; #[debug_handler] -async fn handler(foo: bool) {} +async fn handler(_foo: bool) {} fn main() {} diff --git a/axum-macros/tests/debug_handler/fail/argument_not_extractor.stderr b/axum-macros/tests/debug_handler/fail/argument_not_extractor.stderr index 5f0e8664..0eb6e72c 100644 --- a/axum-macros/tests/debug_handler/fail/argument_not_extractor.stderr +++ b/axum-macros/tests/debug_handler/fail/argument_not_extractor.stderr @@ -1,24 +1,24 @@ 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) {} - | ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool` +5 | async fn handler(_foo: bool) {} + | ^^^^ the trait `FromRequestParts<()>` is not implemented for `bool` | = note: Function argument is not a valid axum extractor. See `https://docs.rs/axum/latest/axum/extract/index.html` for details = help: the following other types implement trait `FromRequestParts`: - <() as FromRequestParts> - <(T1, T2) as FromRequestParts> - <(T1, T2, T3) as FromRequestParts> - <(T1, T2, T3, T4) as FromRequestParts> - <(T1, T2, T3, T4, T5) as FromRequestParts> - <(T1, T2, T3, T4, T5, T6) as FromRequestParts> - <(T1, T2, T3, T4, T5, T6, T7) as FromRequestParts> - <(T1, T2, T3, T4, T5, T6, T7, T8) as FromRequestParts> + > + as FromRequestParts> + > + > + > + as FromRequestParts> + as FromRequestParts> + > 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:4:23 + --> tests/debug_handler/fail/argument_not_extractor.rs:5:24 | -4 | async fn handler(foo: bool) {} - | ^^^^ required by this bound in `__axum_macros_check_handler_0_from_request_check` +5 | async fn handler(_foo: bool) {} + | ^^^^ required by this bound in `__axum_macros_check_handler_0_from_request_check` diff --git a/axum-macros/tests/debug_handler/fail/generics.rs b/axum-macros/tests/debug_handler/fail/generics.rs index dd150767..d6cdf954 100644 --- a/axum-macros/tests/debug_handler/fail/generics.rs +++ b/axum-macros/tests/debug_handler/fail/generics.rs @@ -1,6 +1,6 @@ use axum_macros::debug_handler; #[debug_handler] -async fn handler(extract: T) {} +async fn handler(_extract: T) {} fn main() {} diff --git a/axum-macros/tests/debug_handler/fail/generics.stderr b/axum-macros/tests/debug_handler/fail/generics.stderr index 4a96a0e3..4e15f55a 100644 --- a/axum-macros/tests/debug_handler/fail/generics.stderr +++ b/axum-macros/tests/debug_handler/fail/generics.stderr @@ -1,5 +1,5 @@ error: `#[axum_macros::debug_handler]` doesn't support generic functions --> tests/debug_handler/fail/generics.rs:4:17 | -4 | async fn handler(extract: T) {} +4 | async fn handler(_extract: T) {} | ^^^ diff --git a/axum-macros/tests/debug_handler/fail/json_not_deserialize.stderr b/axum-macros/tests/debug_handler/fail/json_not_deserialize.stderr index 6868e400..ee30bfed 100644 --- a/axum-macros/tests/debug_handler/fail/json_not_deserialize.stderr +++ b/axum-macros/tests/debug_handler/fail/json_not_deserialize.stderr @@ -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` | = help: the following other types implement trait `serde::de::Deserialize<'de>`: - &'a [u8] - &'a serde_json::raw::RawValue - &'a std::path::Path - &'a str - () - (T0, T1) - (T0, T1, T2) - (T0, T1, T2, T3) + bool + char + isize + i8 + i16 + i32 + i64 + i128 and $N others = note: required for `Struct` to implement `serde::de::DeserializeOwned` = note: required for `Json` to implement `FromRequest<()>` diff --git a/axum-macros/tests/debug_handler/fail/not_send.rs b/axum-macros/tests/debug_handler/fail/not_send.rs index df43c9b9..dd65af1c 100644 --- a/axum-macros/tests/debug_handler/fail/not_send.rs +++ b/axum-macros/tests/debug_handler/fail/not_send.rs @@ -2,7 +2,7 @@ use axum_macros::debug_handler; #[debug_handler] async fn handler() { - let rc = std::rc::Rc::new(()); + let _rc = std::rc::Rc::new(()); async {}.await; } diff --git a/axum-macros/tests/debug_handler/fail/not_send.stderr b/axum-macros/tests/debug_handler/fail/not_send.stderr index 465fe938..82f5bb2b 100644 --- a/axum-macros/tests/debug_handler/fail/not_send.stderr +++ b/axum-macros/tests/debug_handler/fail/not_send.stderr @@ -6,14 +6,14 @@ error: future cannot be sent between threads safely | = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` 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(()); - | -- has type `Rc<()>` which is not `Send` +5 | let _rc = std::rc::Rc::new(()); + | --- has type `Rc<()>` which is not `Send` 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 + | - `_rc` is later dropped here note: required by a bound in `check` --> tests/debug_handler/fail/not_send.rs:3:1 | diff --git a/axum-macros/tests/debug_handler/fail/too_many_extractors.rs b/axum-macros/tests/debug_handler/fail/too_many_extractors.rs index d9317bf9..441d0f00 100644 --- a/axum-macros/tests/debug_handler/fail/too_many_extractors.rs +++ b/axum-macros/tests/debug_handler/fail/too_many_extractors.rs @@ -3,23 +3,23 @@ use axum::http::Uri; #[debug_handler] async fn handler( - e1: Uri, - e2: Uri, - e3: Uri, - e4: Uri, - e5: Uri, - e6: Uri, - e7: Uri, - e8: Uri, - e9: Uri, - e10: Uri, - e11: Uri, - e12: Uri, - e13: Uri, - e14: Uri, - e15: Uri, - e16: Uri, - e17: Uri, + _e1: Uri, + _e2: Uri, + _e3: Uri, + _e4: Uri, + _e5: Uri, + _e6: Uri, + _e7: Uri, + _e8: Uri, + _e9: Uri, + _e10: Uri, + _e11: Uri, + _e12: Uri, + _e13: Uri, + _e14: Uri, + _e15: Uri, + _e16: Uri, + _e17: Uri, ) {} fn main() {} diff --git a/axum-macros/tests/debug_handler/fail/too_many_extractors.stderr b/axum-macros/tests/debug_handler/fail/too_many_extractors.stderr index 0ba46212..2cf6486b 100644 --- a/axum-macros/tests/debug_handler/fail/too_many_extractors.stderr +++ b/axum-macros/tests/debug_handler/fail/too_many_extractors.stderr @@ -1,11 +1,11 @@ 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 | -6 | / e1: Uri, -7 | | e2: Uri, -8 | | e3: Uri, -9 | | e4: Uri, +6 | / _e1: Uri, +7 | | _e2: Uri, +8 | | _e3: Uri, +9 | | _e4: Uri, ... | -21 | | e16: Uri, -22 | | e17: Uri, - | |_____________^ +21 | | _e16: Uri, +22 | | _e17: Uri, + | |______________^ diff --git a/axum-macros/tests/debug_handler/fail/wrong_return_type.stderr b/axum-macros/tests/debug_handler/fail/wrong_return_type.stderr index c305e7e7..cc718aae 100644 --- a/axum-macros/tests/debug_handler/fail/wrong_return_type.stderr +++ b/axum-macros/tests/debug_handler/fail/wrong_return_type.stderr @@ -5,14 +5,14 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied | ^^^^ the trait `IntoResponse` is not implemented for `bool` | = help: the following other types implement trait `IntoResponse`: - &'static [u8; N] - &'static [u8] - &'static str - () - (R,) - (Response<()>, R) - (Response<()>, T1, R) - (Response<()>, T1, T2, R) + Box + Box<[u8]> + axum::body::Bytes + Body + axum::extract::rejection::FailedToBufferBody + axum::extract::rejection::LengthLimitError + axum::extract::rejection::UnknownBodyError + axum::extract::rejection::InvalidUtf8 and $N 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 diff --git a/axum-macros/tests/from_request/fail/generic_without_via.rs b/axum-macros/tests/from_request/fail/generic_without_via.rs index f0d54acf..c6b0668a 100644 --- a/axum-macros/tests/from_request/fail/generic_without_via.rs +++ b/axum-macros/tests/from_request/fail/generic_without_via.rs @@ -1,3 +1,4 @@ +#![feature(diagnostic_namespace)] use axum::{routing::get, Router}; use axum_macros::FromRequest; diff --git a/axum-macros/tests/from_request/fail/generic_without_via.stderr b/axum-macros/tests/from_request/fail/generic_without_via.stderr index 961d6a5b..9620e643 100644 --- a/axum-macros/tests/from_request/fail/generic_without_via.stderr +++ b/axum-macros/tests/from_request/fail/generic_without_via.stderr @@ -1,13 +1,13 @@ 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); +6 | struct Extractor(T); | ^ error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future {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 {foo}` | | | 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 | | 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) diff --git a/axum-macros/tests/from_request/fail/generic_without_via_rejection.rs b/axum-macros/tests/from_request/fail/generic_without_via_rejection.rs index b1ce072c..9b748293 100644 --- a/axum-macros/tests/from_request/fail/generic_without_via_rejection.rs +++ b/axum-macros/tests/from_request/fail/generic_without_via_rejection.rs @@ -1,3 +1,4 @@ +#![feature(diagnostic_namespace)] use axum::{routing::get, Router}; use axum_macros::FromRequest; diff --git a/axum-macros/tests/from_request/fail/generic_without_via_rejection.stderr b/axum-macros/tests/from_request/fail/generic_without_via_rejection.stderr index 00eb8d09..ee6739af 100644 --- a/axum-macros/tests/from_request/fail/generic_without_via_rejection.stderr +++ b/axum-macros/tests/from_request/fail/generic_without_via_rejection.stderr @@ -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:6:18 + --> tests/from_request/fail/generic_without_via_rejection.rs:7:18 | -6 | struct Extractor(T); +7 | struct Extractor(T); | ^ error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future {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 {foo}` | | | 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 | | 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) diff --git a/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.rs b/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.rs index e855d5f6..744d31aa 100644 --- a/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.rs +++ b/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.rs @@ -1,3 +1,4 @@ +#![feature(diagnostic_namespace)] use axum::{ extract::rejection::ExtensionRejection, response::{IntoResponse, Response}, diff --git a/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.stderr b/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.stderr index ca8353b2..41252bc3 100644 --- a/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.stderr +++ b/axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.stderr @@ -1,13 +1,13 @@ 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 {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 {handler}` | | | 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 | | 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) error[E0277]: the trait bound `fn(Result) -> impl Future {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) -> impl Future {handler_result}` | | | required by a bound introduced by this call @@ -39,5 +42,8 @@ note: required by a bound in `MethodRouter::::post` --> $WORKSPACE/axum/src/routing/method_routing.rs | | chained_handler_fn!(post, POST); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MethodRouter::::post` + | ^^^^^^^^^^^^^^^^^^^^----^^^^^^^ + | | | + | | required by a bound in this associated function + | required by this bound in `MethodRouter::::post` = note: this error originates in the macro `chained_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/axum-macros/tests/from_request/fail/parts_extracting_body.rs b/axum-macros/tests/from_request/fail/parts_extracting_body.rs index 45a93777..753d92a9 100644 --- a/axum-macros/tests/from_request/fail/parts_extracting_body.rs +++ b/axum-macros/tests/from_request/fail/parts_extracting_body.rs @@ -1,3 +1,4 @@ +#![feature(diagnostic_namespace)] use axum::{extract::FromRequestParts, response::Response}; #[derive(FromRequestParts)] diff --git a/axum-macros/tests/from_request/fail/parts_extracting_body.stderr b/axum-macros/tests/from_request/fail/parts_extracting_body.stderr index 896cf2d9..71a2deda 100644 --- a/axum-macros/tests/from_request/fail/parts_extracting_body.stderr +++ b/axum-macros/tests/from_request/fail/parts_extracting_body.stderr @@ -1,18 +1,18 @@ error[E0277]: the trait bound `String: FromRequestParts` 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` is not implemented for `String` | = note: Function argument is not a valid axum extractor. See `https://docs.rs/axum/latest/axum/extract/index.html` for details = help: the following other types implement trait `FromRequestParts`: - <() as FromRequestParts> - <(T1, T2) as FromRequestParts> - <(T1, T2, T3) as FromRequestParts> - <(T1, T2, T3, T4) as FromRequestParts> - <(T1, T2, T3, T4, T5) as FromRequestParts> - <(T1, T2, T3, T4, T5, T6) as FromRequestParts> - <(T1, T2, T3, T4, T5, T6, T7) as FromRequestParts> - <(T1, T2, T3, T4, T5, T6, T7, T8) as FromRequestParts> + > + > + as FromRequestParts> + > + > + > + as FromRequestParts> + as FromRequestParts> and $N others diff --git a/axum-macros/tests/typed_path/fail/not_deserialize.stderr b/axum-macros/tests/typed_path/fail/not_deserialize.stderr index b476b44f..3ae15fbe 100644 --- a/axum-macros/tests/typed_path/fail/not_deserialize.stderr +++ b/axum-macros/tests/typed_path/fail/not_deserialize.stderr @@ -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` | = help: the following other types implement trait `serde::de::Deserialize<'de>`: - &'a [u8] - &'a serde_json::raw::RawValue - &'a std::path::Path - &'a str - () - (T0, T1) - (T0, T1, T2) - (T0, T1, T2, T3) + bool + char + isize + i8 + i16 + i32 + i64 + i128 and $N others = note: required for `MyPath` to implement `serde::de::DeserializeOwned` = note: required for `axum::extract::Path` to implement `FromRequestParts` diff --git a/axum/src/handler/mod.rs b/axum/src/handler/mod.rs index 5efa29ba..a75c2046 100644 --- a/axum/src/handler/mod.rs +++ b/axum/src/handler/mod.rs @@ -127,7 +127,7 @@ pub use self::service::HandlerService; /// ``` #[cfg_attr( nightly_error_messages, - rustc_on_unimplemented( + diagnostic::on_unimplemented( note = "Consider using `#[axum::debug_handler]` to improve the error message" ) )] diff --git a/axum/src/lib.rs b/axum/src/lib.rs index d30d1f00..3a64dd73 100644 --- a/axum/src/lib.rs +++ b/axum/src/lib.rs @@ -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. //! //! # Table of contents @@ -416,7 +416,7 @@ missing_debug_implementations, missing_docs )] -#![deny(unreachable_pub, private_in_public)] +#![deny(unreachable_pub)] #![allow(elided_lifetimes_in_paths, clippy::type_complexity)] // 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`