Skip to content
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

Change order of async and unsafe modifiers in instrument procmacro #2864

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

kaffarell
Copy link
Contributor

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

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 <g.goller@proxmox.com>
@kaffarell kaffarell requested review from hawkw and a team as code owners January 26, 2024 12:56
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing this, and for adding a test!

@hawkw
Copy link
Member

hawkw commented Jan 26, 2024

warnings job failure is unrelated, let's fix that separately: https://github.com/tokio-rs/tracing/actions/runs/7668345432/job/20899985659#step:4:1

@hawkw hawkw merged commit 0e4a4be into tokio-rs:v0.1.x Jan 26, 2024
50 of 51 checks passed
kaffarell added a commit to kaffarell/tracing that referenced this pull request 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 <g.goller@proxmox.com>
@kaffarell
Copy link
Contributor Author

@hawkw had a look at the job failure and it seems like the private_in_public lint is now deprecated. They link to the RFC, which mentions that I has been split up in three other lints: private_interfaces, private_bounds and unnameable_types 1. The problem is that the third one (unnameable_types) is not stabilized yet 2 :/.
As the first two are currently warn-by-default we only have to add unnameable_types once it's stabilized.

Footnotes

  1. https://rust-lang.github.io/rfcs/2145-type-privacy.html

  2. https://github.com/rust-lang/rust/pull/120144

@kaffarell
Copy link
Contributor Author

I could already go ahead and add it so that we won't forget? It will only return a unknown_lint warning anyway...

@hawkw
Copy link
Member

hawkw commented Feb 16, 2024

Please do! Thank you!

@kaffarell
Copy link
Contributor Author

kaffarell commented Feb 19, 2024

Opened it: #2886!

kaffarell added a commit to kaffarell/tracing that referenced this pull request 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 <g.goller@proxmox.com>
davidbarsky pushed a commit that referenced this pull request 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 <g.goller@proxmox.com>
davidbarsky pushed a commit that referenced this pull request 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 <g.goller@proxmox.com>
davidbarsky pushed a commit that referenced this pull request 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 <g.goller@proxmox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants