Skip to content

Commit 88f5be2

Browse files
committed
Auto merge of rust-lang#8262 - 1nF0rmed:chore-update-borrowed-box-doc, r=camsteffen
Improve documentation for `borrowed-box` lint fixes rust-lang#8161 Updates documentation to elaborate more on how removing Box from a function parameter can generalize the function. changelog: none
2 parents fd9cebe + 7e989ec commit 88f5be2

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)