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

chore: new clippy/rust lints #2948

Merged
merged 1 commit into from May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions tracing-attributes/src/expand.rs
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
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
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
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
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-subscriber/src/registry/sharded.rs
Expand Up @@ -592,6 +592,7 @@ mod tests {
closed: Vec<(&'static str, Weak<()>)>,
}

#[allow(dead_code)]
struct SetRemoved(Arc<()>);

impl<C> Subscribe<C> for CloseSubscriber
Expand Down
1 change: 1 addition & 0 deletions tracing/tests/instrument.rs
Expand Up @@ -21,6 +21,7 @@ fn span_on_drop() {
}
}

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

impl Future for Fut {
Expand Down