Open damccull opened 1 year ago
The code which triggers this lint is generated here: https://github.com/tokio-rs/tracing/blob/e603c2a254d157a25a7a1fbfd4da46ad7e05f555/tracing-attributes/src/expand.rs#L60-L73
When the return type is an impl Trait
, the #return_type
here is _
.
I think there are two solutions for this:
clippy::let_with_type_underscore
to the allowed lintsimpl Trait
, because that block doesn't help with inference in those cases?This issue seems to have been fixed #2609.
However, what this did to us is clippy now fails for us because we're using an older rust version, where this lint is not present yet.
I don't think adding a warning to compilation is a breaking change, but it might be worthwhile to also add #![allow(unknown_lints)]
for this and future similar cases where we do not want to break all compilations, right?
This issue has been fixed and can be closed now.
When I updated to the latest clippy via rustup update, I ran into a new lint that doesn't seem to like returning
impl SomeTrait
: https://rust-lang.github.io/rust-clippy/master/index.html#/let_with_type_underscoreSo tracing, when used like this is causing this lint to trigger.