-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid unhelpful compiler suggestion (#1251)
- Loading branch information
1 parent
0d9afd9
commit 93e1b51
Showing
3 changed files
with
22 additions
and
26 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use axum_macros::debug_handler; | ||
|
||
#[debug_handler] | ||
async fn handler<T>() {} | ||
async fn handler<T>(extract: T) {} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -1,16 +1,5 @@ | ||
error: `#[axum_macros::debug_handler]` doesn't support generic functions | ||
--> tests/debug_handler/fail/generics.rs:4:17 | ||
| | ||
4 | async fn handler<T>() {} | ||
4 | async fn handler<T>(extract: T) {} | ||
| ^^^ | ||
|
||
error[E0282]: type annotations needed | ||
--> tests/debug_handler/fail/generics.rs:4:10 | ||
| | ||
4 | async fn handler<T>() {} | ||
| ^^^^^^^ cannot infer type of the type parameter `T` declared on the function `handler` | ||
| | ||
help: consider specifying the generic argument | ||
| | ||
4 | async fn handler::<T><T>() {} | ||
| +++++ |