Revert "feat: add #[diagnostic::on_unimplemented] to IntoResponse and IntoResponseParts (#3723)"

This reverts commit 7bf2f675ef.
This commit is contained in:
David Pedersen
2026-05-05 15:04:03 +02:00
parent c2bf6db649
commit b7d082a7a9
16 changed files with 50 additions and 115 deletions
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `bool: FromRequest<(), axum_core::extract::private
--> tests/debug_handler/fail/argument_not_extractor.rs:4:24
|
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.
See `https://docs.rs/axum/0.8/axum/extract/index.html` for details
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `NonCloneType: Clone` is not satisfied
--> tests/debug_handler/fail/extension_not_clone.rs:7:38
|
7 | async fn test_extension_non_clone(_: Extension<NonCloneType>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NonCloneType`
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NonCloneType`, which is required by `Extension<NonCloneType>: FromRequest<(), _>`
|
= help: the following other types implement trait `FromRequest<S, M>`:
Body
@@ -2,13 +2,8 @@ error[E0277]: the trait bound `Struct: serde::Deserialize<'de>` is not satisfied
--> tests/debug_handler/fail/json_not_deserialize.rs:7:24
|
7 | async fn handler(_foo: Json<Struct>) {}
| ^^^^^^^^^^^^ unsatisfied trait bound
| ^^^^^^^^^^^^ the trait `for<'de> serde_core::de::Deserialize<'de>` is not implemented for `Struct`, which is required by `Json<Struct>: FromRequest<()>`
|
help: the trait `for<'de> serde_core::de::Deserialize<'de>` is not implemented for `Struct`
--> tests/debug_handler/fail/json_not_deserialize.rs:4:1
|
4 | struct Struct {}
| ^^^^^^^^^^^^^
= note: for local types consider adding `#[derive(serde::Deserialize)]` to your `Struct` type
= note: for types from other crates check whether the crate offers a `serde` feature flag
= help: the following other types implement trait `serde_core::de::Deserialize<'de>`:
@@ -23,6 +18,7 @@ help: the trait `for<'de> serde_core::de::Deserialize<'de>` is not implemented f
and $N others
= note: required for `Struct` to implement `serde_core::de::DeserializeOwned`
= note: required for `Json<Struct>` to implement `FromRequest<()>`
= help: see issue #48214
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
1 + #![feature(trivial_bounds)]
@@ -32,13 +28,8 @@ error[E0277]: the trait bound `Struct: serde::Deserialize<'de>` is not satisfied
--> tests/debug_handler/fail/json_not_deserialize.rs:7:24
|
7 | async fn handler(_foo: Json<Struct>) {}
| ^^^^^^^^^^^^ unsatisfied trait bound
| ^^^^^^^^^^^^ the trait `for<'de> serde_core::de::Deserialize<'de>` is not implemented for `Struct`, which is required by `Json<Struct>: FromRequest<()>`
|
help: the trait `for<'de> serde_core::de::Deserialize<'de>` is not implemented for `Struct`
--> tests/debug_handler/fail/json_not_deserialize.rs:4:1
|
4 | struct Struct {}
| ^^^^^^^^^^^^^
= note: for local types consider adding `#[derive(serde::Deserialize)]` to your `Struct` type
= note: for types from other crates check whether the crate offers a `serde` feature flag
= help: the following other types implement trait `serde_core::de::Deserialize<'de>`:
@@ -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
|
@@ -1,11 +1,11 @@
error: Cannot return tuples with more than 17 elements
--> tests/debug_handler/fail/output_tuple_too_many.rs:4:20
|
4 | async fn handler() -> (
4 | async fn handler() -> (
| ____________________^
5 | | axum::http::StatusCode,
6 | | AppendHeaders<[(axum::http::HeaderName, &'static str); 1]>,
7 | | AppendHeaders<[(axum::http::HeaderName, &'static str); 1]>,
5 | | axum::http::StatusCode,
6 | | AppendHeaders<[(axum::http::HeaderName, &'static str); 1]>,
7 | | AppendHeaders<[(axum::http::HeaderName, &'static str); 1]>,
... |
23 | | axum::http::StatusCode,
24 | | ) {
@@ -2,14 +2,8 @@ error[E0277]: the trait bound `NotIntoResponse: IntoResponse` is not satisfied
--> tests/debug_handler/fail/single_wrong_return_tuple.rs:6:23
|
6 | async fn handler() -> (NotIntoResponse) {
| ^^^^^^^^^^^^^^^^^ unsatisfied trait bound
| ^^^^^^^^^^^^^^^^^ the trait `IntoResponse` is not implemented for `NotIntoResponse`
|
help: the trait `IntoResponse` is not implemented for `NotIntoResponse`
--> tests/debug_handler/fail/single_wrong_return_tuple.rs:3:1
|
3 | struct NotIntoResponse;
| ^^^^^^^^^^^^^^^^^^^^^^
= note: See `https://docs.rs/axum/0.8/axum/response/trait.IntoResponse.html` for details
= help: the following other types implement trait `IntoResponse`:
&'static [u8; N]
&'static [u8]
@@ -1,10 +1,10 @@
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,
@@ -8,14 +8,8 @@ error[E0277]: the trait bound `CustomIntoResponse: IntoResponseParts` is not sat
--> tests/debug_handler/fail/wrong_return_tuple.rs:21:5
|
21 | CustomIntoResponse,
| ^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
| ^^^^^^^^^^^^^^^^^^ the trait `IntoResponseParts` is not implemented for `CustomIntoResponse`
|
help: the trait `IntoResponseParts` is not implemented for `CustomIntoResponse`
--> tests/debug_handler/fail/wrong_return_tuple.rs:12:1
|
12 | struct CustomIntoResponse {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: See `https://docs.rs/axum/0.8/axum/response/trait.IntoResponseParts.html` for details
= help: the following other types implement trait `IntoResponseParts`:
()
(T1, T2)
@@ -26,23 +20,18 @@ help: the trait `IntoResponseParts` is not implemented for `CustomIntoResponse`
(T1, T2, T3, T4, T5, T6, T7)
(T1, T2, T3, T4, T5, T6, T7, T8)
and $N others
= help: see issue #48214
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
3 + #![feature(trivial_bounds)]
3 + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `CustomIntoResponse: IntoResponseParts` is not satisfied
--> tests/debug_handler/fail/wrong_return_tuple.rs:21:5
|
21 | CustomIntoResponse,
| ^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
| ^^^^^^^^^^^^^^^^^^ the trait `IntoResponseParts` is not implemented for `CustomIntoResponse`
|
help: the trait `IntoResponseParts` is not implemented for `CustomIntoResponse`
--> tests/debug_handler/fail/wrong_return_tuple.rs:12:1
|
12 | struct CustomIntoResponse {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: See `https://docs.rs/axum/0.8/axum/response/trait.IntoResponseParts.html` for details
= help: the following other types implement trait `IntoResponseParts`:
()
(T1, T2)
@@ -4,7 +4,6 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
4 | async fn handler() -> bool {
| ^^^^ the trait `IntoResponse` is not implemented for `bool`
|
= note: See `https://docs.rs/axum/0.8/axum/response/trait.IntoResponse.html` for details
= help: the following other types implement trait `IntoResponse`:
&'static [u8; N]
&'static [u8]