Use call-site span for future Send check in debug_handler

This commit is contained in:
Jonas Platte
2023-01-30 21:47:57 +01:00
parent 4a5dc4391c
commit bdfaedb344
3 changed files with 21 additions and 26 deletions
@@ -1,11 +1,8 @@
error: future cannot be sent between threads safely
--> tests/debug_handler/fail/not_send.rs:4:1
--> tests/debug_handler/fail/not_send.rs:3:1
|
4 | / async fn handler() {
5 | | let rc = std::rc::Rc::new(());
6 | | async {}.await;
7 | | }
| |_^ future returned by `handler` is not `Send`
3 | #[debug_handler]
| ^^^^^^^^^^^^^^^^ future returned by `handler` is not `Send`
|
= 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
@@ -18,10 +15,8 @@ note: future is not `Send` as this value is used across an await
7 | }
| - `rc` is later dropped here
note: required by a bound in `check`
--> tests/debug_handler/fail/not_send.rs:4:1
--> tests/debug_handler/fail/not_send.rs:3:1
|
4 | / async fn handler() {
5 | | let rc = std::rc::Rc::new(());
6 | | async {}.await;
7 | | }
| |_^ required by this bound in `check`
3 | #[debug_handler]
| ^^^^^^^^^^^^^^^^ required by this bound in `check`
= note: this error originates in the attribute macro `debug_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -13,9 +13,9 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
(Response<()>, T1, R)
(Response<()>, T1, T2, R)
(Response<()>, T1, T2, T3, R)
and 124 others
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
|
4 | async fn handler() -> bool {
| ^^^^ required by this bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
| ^^^^ required by this bound in `check`