-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute macros #51
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a problem I kept running into with async functions with something like Axum/Hyper.
With the async function syntax, it is very easy for its output Future to accidentally not be
Send
because the compiler thinks you are holding onto something that is notSend
across an await point. One example would be a (synchronous/blocking)MutexGuard
.For example:
Some related background information:
-Zdrop-tracking
by default rust-lang/rust#97331This matters because the
!Send
-ness can propagate up very far and eventually when mounting the handler to something like the Axum router, it causes a cryptic error and takes a long time to trace back to where the problem is.To guard against these kind of issues, I can do something like this (a bit simplified):
This works but is pretty distracting. It would be nice to be able to do something like:
While looking for something that does that, this crate came up. Does something like that seem like a good fit for this crate, or are there some reasons why it is not possible/not a good fit?
The text was updated successfully, but these errors were encountered: