chore: new clippy/rust lints (#2948)

## Motivation

clippy is failing with recent Rust toolchain up to 1.77.2.

## Solution

Give clippy what it wants.
This commit is contained in:
Dawid Ciężarkiewicz
2024-05-02 04:25:51 -07:00
committed by GitHub
parent 908cc432a5
commit 9adfa7bebd
7 changed files with 8 additions and 0 deletions

View File

@@ -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,

View File

@@ -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))]

View File

@@ -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
}
}

View File

@@ -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! {
@@ -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! {

View File

@@ -55,6 +55,7 @@ fn span_on_drop() {
}
}
#[allow(dead_code)]
struct Fut(Option<AssertSpanOnDrop>);
impl Future for Fut {

View File

@@ -592,6 +592,7 @@ mod tests {
closed: Vec<(&'static str, Weak<()>)>,
}
#[allow(dead_code)]
struct SetRemoved(Arc<()>);
impl<C> Subscribe<C> for CloseSubscriber

View File

@@ -21,6 +21,7 @@ fn span_on_drop() {
}
}
#[allow(dead_code)]
struct Fut(Option<AssertSpanOnDrop>);
impl Future for Fut {