about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/functions.rs7
-rw-r--r--tests/ui-toml/functions_maxlines/test.stderr4
-rw-r--r--tests/ui/functions_maxlines.stderr2
3 files changed, 9 insertions, 4 deletions
diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs
index 89fde1d509d..50b39cf4ea7 100644
--- a/clippy_lints/src/functions.rs
+++ b/clippy_lints/src/functions.rs
@@ -374,7 +374,12 @@ impl<'tcx> Functions {
         }
 
         if line_count > self.max_lines {
-            span_lint(cx, TOO_MANY_LINES, span, "this function has a large number of lines")
+            span_lint(
+                cx,
+                TOO_MANY_LINES,
+                span,
+                &format!("this function has too many lines ({}/{})", line_count, self.max_lines),
+            )
         }
     }
 
diff --git a/tests/ui-toml/functions_maxlines/test.stderr b/tests/ui-toml/functions_maxlines/test.stderr
index fb12257021a..a27ce945ca5 100644
--- a/tests/ui-toml/functions_maxlines/test.stderr
+++ b/tests/ui-toml/functions_maxlines/test.stderr
@@ -1,4 +1,4 @@
-error: this function has a large number of lines
+error: this function has too many lines (2/1)
   --> $DIR/test.rs:18:1
    |
 LL | / fn too_many_lines() {
@@ -9,7 +9,7 @@ LL | | }
    |
    = note: `-D clippy::too-many-lines` implied by `-D warnings`
 
-error: this function has a large number of lines
+error: this function has too many lines (2/1)
   --> $DIR/test.rs:38:1
    |
 LL | / fn comment_before_code() {
diff --git a/tests/ui/functions_maxlines.stderr b/tests/ui/functions_maxlines.stderr
index c640c82d6d7..dc6c8ba2f15 100644
--- a/tests/ui/functions_maxlines.stderr
+++ b/tests/ui/functions_maxlines.stderr
@@ -1,4 +1,4 @@
-error: this function has a large number of lines
+error: this function has too many lines (102/100)
   --> $DIR/functions_maxlines.rs:58:1
    |
 LL | / fn bad_lines() {