mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-14 02:40:47 +01:00
c7b8813c47
The things are also covered by the doc tests but this also gives us assertions on the errors produced, which is the whole point of this crate :)
21 lines
802 B
Text
21 lines
802 B
Text
error: future cannot be sent between threads safely
|
|
--> tests/fail/not_send.rs:4:10
|
|
|
|
|
4 | async fn handler() {
|
|
| ^^^^^^^ future returned by `handler` is not `Send`
|
|
|
|
|
= 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/fail/not_send.rs:6:5
|
|
|
|
|
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
|
|
7 | }
|
|
| - `rc` is later dropped here
|
|
note: required by a bound in `handler::{closure#0}::debug_handler`
|
|
--> tests/fail/not_send.rs:4:10
|
|
|
|
|
4 | async fn handler() {
|
|
| ^^^^^^^ required by this bound in `handler::{closure#0}::debug_handler`
|