forked from tokio-rs/axum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve debug_handler macro on tuple output types.
Refs: tokio-rs#2173
- Loading branch information
1 parent
24f0f3e
commit 52c5634
Showing
3 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
axum-macros/tests/debug_handler/fail/wrong_return_tuple.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
#[axum::debug_handler] | ||
async fn handler() -> ( | ||
axum::http::StatusCode, | ||
axum::Json<&'static str>, | ||
axum::response::AppendHeaders<[( axum::http::HeaderName,&'static str); 1]>, | ||
) { | ||
panic!() | ||
} | ||
|
||
fn main(){} |
18 changes: 18 additions & 0 deletions
18
axum-macros/tests/debug_handler/fail/wrong_return_tuple.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error[E0277]: the trait bound `Json<&'static str>: IntoResponseParts` is not satisfied | ||
--> tests/debug_handler/fail/wrong_return_tuple.rs:5:5 | ||
| | ||
5 | axum::Json<&'static str>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoResponseParts` is not implemented for `Json<&'static str>` | ||
| | ||
= help: the following other types implement trait `IntoResponseParts`: | ||
(T1, T2) | ||
(T1, T2, T3) | ||
(T1, T2, T3, T4) | ||
(T1, T2, T3, T4, T5) | ||
(T1, T2, T3, T4, T5, T6) | ||
(T1, T2, T3, T4, T5, T6, T7) | ||
(T1, T2, T3, T4, T5, T6, T7, T8) | ||
(T1, T2, T3, T4, T5, T6, T7, T8, T9) | ||
and $N others | ||
= help: see issue #48214 | ||
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable |