-
Notifications
You must be signed in to change notification settings - Fork 741
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
bug: #[tracing::instrument]
reorders async
and unsafe
keywords
#2576
Comments
kaffarell
added a commit
to kaffarell/tracing
that referenced
this issue
Jan 26, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: tokio-rs#2576 Signed-off-by: Gabriel Goller <[email protected]>
kaffarell
added a commit
to kaffarell/tracing
that referenced
this issue
Jan 26, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: tokio-rs#2576 Signed-off-by: Gabriel Goller <[email protected]>
hawkw
pushed a commit
that referenced
this issue
Jan 26, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: #2576 Signed-off-by: Gabriel Goller <[email protected]>
kaffarell
added a commit
to kaffarell/tracing
that referenced
this issue
Feb 14, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: tokio-rs#2576 Signed-off-by: Gabriel Goller <[email protected]>
I think we can close this issue manually though @hawkw? |
kaffarell
added a commit
to kaffarell/tracing
that referenced
this issue
May 22, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: tokio-rs#2576 Signed-off-by: Gabriel Goller <[email protected]>
davidbarsky
pushed a commit
that referenced
this issue
Oct 2, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: #2576 Signed-off-by: Gabriel Goller <[email protected]>
davidbarsky
pushed a commit
that referenced
this issue
Oct 2, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: #2576 Signed-off-by: Gabriel Goller <[email protected]>
davidbarsky
pushed a commit
that referenced
this issue
Oct 2, 2024
When using `#[tracing::instrument]` and the `async unsafe` modifiers the generated function read `unsafe async fn`, which is wrong. Corrected the order and added a test. Fixes: #2576 Signed-off-by: Gabriel Goller <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Version
tracing v0.1.37
Platform
Crates
tracing
Description
Currently you cannot use the
#[tracing::instrument]
macro to instrument an unsafe async function. The problem is the macro re-orders theasync
andunsafe
keywords in the wrong order.Minimum Repro:
Playground
This fails to compile with the error:
Using rust-analyzer you can see what this expands to:
And indeed if you look at the first line of the expansion you can see
unsafe async
when it should beasync unsafe
.The text was updated successfully, but these errors were encountered: