Closed
Description
I'm not sure that this is an issue, but it can be a little confusing.
I have the following situation: there is a function that works with panic::catch_unwind
error (Box<Any + Send + 'static>
):
fn foo(e: &Box<Any + Send>) {
if let Some(s) = e.as_ref().downcast_ref::<&str>() { ... }
...
}
Clippy suggests the following:
warning: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> src/main.rs:4:11
|
4 | fn foo(e: &Box<Any + Send>) {
| ^^^^^^^^^^^^^^^^ help: try `&Any + Send`
Functions becomes more generic, that for sure, but Any
is a specific type: foo
call site must be updated otherwise instead of Any
that contains a panic error it will take Any
that contains Box<Any + Send>
.
Probably borrowed_box
lint should be disabled for Any
type?