tokio-rs / tracing

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

Let `dead_code` lint work on `#[instrument]`ed functions #3108

Open 9999years opened 1 month ago

9999years commented 1 month ago

Motivation

#[instrument]ed functions never trigger a dead_code lint.

Closes (partially?) #1366

Solution

Include all of the input tokens in the output. In particular, the brace tokens surrounding the function body, the parenthesis surrounding the function parameters, and the angle brackets surrounding the generics must be included.

Prior art: https://github.com/andrewhickman/fn-error-context/commit/cfa749aaef91157bae8d3a984e6650bc00f6af68