Skip to content

Commit

Permalink
fix: new clippy/rust lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dpc committed Apr 23, 2024
1 parent 908cc43 commit e969db1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tracing-attributes/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ impl<'a> VisitMut for IdentAndTypesRenamer<'a> {
}

// A visitor struct that replace an async block by its patched version
#[allow(dead_code)]
struct AsyncTraitBlockReplacer<'a> {
block: &'a Block,
patched_block: Block,
Expand Down
1 change: 1 addition & 0 deletions tracing-attributes/tests/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ fn fields() {

#[test]
fn skip() {
#[allow(dead_code)]
struct UnDebug(pub u32);

#[instrument(target = "my_target", level = "debug", skip(_arg2, _arg3))]
Expand Down
1 change: 1 addition & 0 deletions tracing-core/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ pub(crate) fn get_global() -> &'static Dispatch {
unsafe {
// This is safe given the invariant that setting the global dispatcher
// also sets `GLOBAL_INIT` to `INITIALIZED`.
#[allow(static_mut_refs)]
&GLOBAL_DISPATCH
}
}
Expand Down
2 changes: 2 additions & 0 deletions tracing-core/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ mod test {
use crate::metadata::{Kind, Level, Metadata};

// Make sure TEST_CALLSITE_* have non-zero size, so they can't be located at the same address.
#[allow(dead_code)]
struct TestCallsite1(u8);
static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1(0);
static TEST_META_1: Metadata<'static> = metadata! {
Expand All @@ -987,6 +988,7 @@ mod test {
}
}

#[allow(dead_code)]
struct TestCallsite2(u8);
static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2(0);
static TEST_META_2: Metadata<'static> = metadata! {
Expand Down
1 change: 1 addition & 0 deletions tracing-futures/tests/std_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fn span_on_drop() {
}
}

#[allow(dead_code)]
struct Fut(Option<AssertSpanOnDrop>);

impl Future for Fut {
Expand Down
1 change: 1 addition & 0 deletions tracing/tests/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fn span_on_drop() {
}
}

#[allow(dead_code)]
struct Fut(Option<AssertSpanOnDrop>);

impl Future for Fut {
Expand Down

0 comments on commit e969db1

Please sign in to comment.