Skip to content

Commit 824f2e7

Browse files
committed
Auto merge of #10724 - lukaslueg:largeerrdocs, r=giraffate
Clarify docs for `RESULT_LARGE_ERR` Adds a paragraph to address #10211 (comment) changelog: [`result_large_err`]: Update the document
2 parents 7bc3da9 + 2ed254e commit 824f2e7

File tree

1 file changed

+5
-0
lines changed
  • clippy_lints/src/functions

1 file changed

+5
-0
lines changed

clippy_lints/src/functions/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ declare_clippy_lint! {
252252
/// A `Result` is at least as large as the `Err`-variant. While we
253253
/// expect that variant to be seldomly used, the compiler needs to reserve
254254
/// and move that much memory every single time.
255+
/// Furthermore, errors are often simply passed up the call-stack, making
256+
/// use of the `?`-operator and its type-conversion mechanics. If the
257+
/// `Err`-variant further up the call-stack stores the `Err`-variant in
258+
/// question (as library code often does), it itself needs to be at least
259+
/// as large, propagating the problem.
255260
///
256261
/// ### Known problems
257262
/// The size determined by Clippy is platform-dependent.

0 commit comments

Comments
 (0)