We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
borrowed-box
1 parent b66dbe8 commit 7e989ecCopy full SHA for 7e989ec
clippy_lints/src/types/mod.rs
@@ -167,8 +167,9 @@ declare_clippy_lint! {
167
/// Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information.
168
///
169
/// ### Why is this bad?
170
- /// Any `&Box<T>` can also be a `&T`, which is more
171
- /// general.
+ /// A `&Box<T>` parameter requires the function caller to box `T` first before passing it to a function.
+ /// Using `&T` defines a concrete type for the parameter and generalizes the function, this would also
172
+ /// auto-deref to `&T` at the function call site if passed a `&Box<T>`.
173
174
/// ### Example
175
/// ```rust,ignore
0 commit comments