Skip to content

instrument macro sometimes triggers clippy::let_with_type_underscore #2503

Open
@jplatte

Description

@jplatte

Bug Report

Version

v0.1.37

Platform

Linux 6.2.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 03 Mar 2023 15:58:31 +0000 x86_64 GNU/Linux

Description

Clippy introduced a new lint let_with_type_underscore that triggers on let pattern: _ = expression; in rust-lang/rust-clippy#10463. It seems to trigger on #[instrument]ed function that return impl Trait + 'lt, for instance one function I saw it was the function

#[instrument(name = "sync_stream", skip_all, parent = &self.inner.client.inner.root_span)]
pub fn stream(&self) -> impl Stream<Item = Result<UpdateSummary, crate::Error>> + '_ {
    // ...
}

(and naming the lifetime didn't help)

Metadata

Metadata

Assignees

No one assigned

    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