Skip to content

Commit 7e989ec

Browse files
committed
Improve documentation for borrowed-box lint
1 parent b66dbe8 commit 7e989ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/types/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ declare_clippy_lint! {
167167
/// Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information.
168168
///
169169
/// ### Why is this bad?
170-
/// Any `&Box<T>` can also be a `&T`, which is more
171-
/// general.
170+
/// A `&Box<T>` parameter requires the function caller to box `T` first before passing it to a function.
171+
/// 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>`.
172173
///
173174
/// ### Example
174175
/// ```rust,ignore

0 commit comments

Comments
 (0)