From 7e989ec07a2725c8ba88f2030ef7099bb44f08e6 Mon Sep 17 00:00:00 2001 From: Pradyumna Rahul Date: Mon, 10 Jan 2022 21:44:10 +0530 Subject: [PATCH] Improve documentation for `borrowed-box` lint --- clippy_lints/src/types/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/types/mod.rs b/clippy_lints/src/types/mod.rs index 481e59574358..9d57505e55ed 100644 --- a/clippy_lints/src/types/mod.rs +++ b/clippy_lints/src/types/mod.rs @@ -167,8 +167,9 @@ declare_clippy_lint! { /// Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information. /// /// ### Why is this bad? - /// Any `&Box` can also be a `&T`, which is more - /// general. + /// A `&Box` 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 + /// auto-deref to `&T` at the function call site if passed a `&Box`. /// /// ### Example /// ```rust,ignore