about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Lueg <lukas.lueg@gmail.com>2023-04-29 14:18:31 +0200
committerLukas Lueg <lukas.lueg@gmail.com>2023-04-29 14:18:31 +0200
commit2ed254e29f237c90bafdc1c064f98c61cf42f685 (patch)
treef2df143e58c0a9f441942305dcf8ed5d8a419b57
parent3594d55439410b9426a4eb81b125b750b1dea36d (diff)
Clarify docs for RESULT_LARGE_ERR
-rw-r--r--clippy_lints/src/functions/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs
index 1528a7be09c..ee10334c67f 100644
--- a/clippy_lints/src/functions/mod.rs
+++ b/clippy_lints/src/functions/mod.rs
@@ -252,6 +252,11 @@ declare_clippy_lint! {
     /// A `Result` is at least as large as the `Err`-variant. While we
     /// expect that variant to be seldomly used, the compiler needs to reserve
     /// and move that much memory every single time.
+    /// Furthermore, errors are often simply passed up the call-stack, making
+    /// use of the `?`-operator and its type-conversion mechanics. If the
+    /// `Err`-variant further up the call-stack stores the `Err`-variant in
+    /// question (as library code often does), it itself needs to be at least
+    /// as large, propagating the problem.
     ///
     /// ### Known problems
     /// The size determined by Clippy is platform-dependent.