tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.19k stars 677 forks source link

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

Closed kaffarell closed 6 months ago

kaffarell commented 6 months ago

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

hawkw commented 6 months ago

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

kaffarell commented 5 months ago

@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 ^0. The problem is that the third one (unnameable_types) is not stabilized yet ^1 :/. As the first two are currently warn-by-default we only have to add unnameable_types once it's stabilized.

kaffarell commented 5 months ago

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

hawkw commented 5 months ago

Please do! Thank you!

kaffarell commented 5 months ago

Opened it: #2886!