Skip to content

#[trace] attribute suppresses dead_code warnings for unused functionsΒ #156

@drmingdrmer

Description

@drmingdrmer

Summary

The #[fastrace::trace] attribute suppresses Rust's dead_code lint, causing the compiler to not warn about unused functions.

Reproduction

struct Foo;

impl Foo {
    // No warning - even though this function is never called
    #[fastrace::trace]
    async fn unused_function(&self) -> i32 {
        42
    }
}

Expected behavior

The compiler should warn: method 'unused_function' is never used.

Actual behavior

No warning. Removing #[fastrace::trace] causes the warning to appear.

Environment

  • fastrace 0.7.14 with enable feature enabled
  • rustc 1.94.0-nightly (f52090008 2025-12-10)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions