about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-07 11:05:03 +0100
committerGitHub <noreply@github.com>2021-12-07 11:05:03 +0100
commita8f47dc7aa237b074f718c446b040e86ac633b17 (patch)
tree54452d6b1c1c74e783e9618f5afad41edf950055 /src/test
parentdd929ae4c56bbffb465ad12e70c9f40adfffe57f (diff)
parent93564c317ba34b9059197cc4985d32efae147730 (diff)
downloadrust-a8f47dc7aa237b074f718c446b040e86ac633b17.tar.gz
rust-a8f47dc7aa237b074f718c446b040e86ac633b17.zip
Rollup merge of #91503 - estebank:call-fn-span, r=michaelwoerister
Tweak "call this function" suggestion to have smaller span
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/fn/fn-compare-mismatch.stderr4
-rw-r--r--src/test/ui/issues/issue-59488.stderr16
-rw-r--r--src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr5
3 files changed, 18 insertions, 7 deletions
diff --git a/src/test/ui/fn/fn-compare-mismatch.stderr b/src/test/ui/fn/fn-compare-mismatch.stderr
index 585f556abc8..096440225b9 100644
--- a/src/test/ui/fn/fn-compare-mismatch.stderr
+++ b/src/test/ui/fn/fn-compare-mismatch.stderr
@@ -9,11 +9,11 @@ LL |     let x = f == g;
 help: you might have forgotten to call this function
    |
 LL |     let x = f() == g;
-   |             ~~~
+   |              ++
 help: you might have forgotten to call this function
    |
 LL |     let x = f == g();
-   |                  ~~~
+   |                   ++
 
 error[E0308]: mismatched types
   --> $DIR/fn-compare-mismatch.rs:4:18
diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr
index f739557e001..47fd9fdb654 100644
--- a/src/test/ui/issues/issue-59488.stderr
+++ b/src/test/ui/issues/issue-59488.stderr
@@ -5,7 +5,11 @@ LL |     foo > 12;
    |     --- ^ -- {integer}
    |     |
    |     fn() -> i32 {foo}
-   |     help: you might have forgotten to call this function: `foo()`
+   |
+help: you might have forgotten to call this function
+   |
+LL |     foo() > 12;
+   |        ++
 
 error[E0308]: mismatched types
   --> $DIR/issue-59488.rs:14:11
@@ -23,7 +27,11 @@ LL |     bar > 13;
    |     --- ^ -- {integer}
    |     |
    |     fn(i64) -> i64 {bar}
-   |     help: you might have forgotten to call this function: `bar( /* arguments */ )`
+   |
+help: you might have forgotten to call this function
+   |
+LL |     bar( /* arguments */ ) > 13;
+   |        +++++++++++++++++++
 
 error[E0308]: mismatched types
   --> $DIR/issue-59488.rs:18:11
@@ -45,11 +53,11 @@ LL |     foo > foo;
 help: you might have forgotten to call this function
    |
 LL |     foo() > foo;
-   |     ~~~~~
+   |        ++
 help: you might have forgotten to call this function
    |
 LL |     foo > foo();
-   |           ~~~~~
+   |              ++
 
 error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
   --> $DIR/issue-59488.rs:25:9
diff --git a/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr b/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr
index cd4cc969200..4c11f354494 100644
--- a/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr
+++ b/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr
@@ -6,9 +6,12 @@ LL |     assert_eq!(a, 0);
    |     |
    |     fn() -> i32 {a}
    |     {integer}
-   |     help: you might have forgotten to call this function: `*left_val()`
    |
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have forgotten to call this function
+   |
+LL |                 if !(*left_val() == *right_val) {
+   |                               ++
 
 error[E0308]: mismatched types
   --> $DIR/issue-70724-add_type_neq_err_label-unwrap.rs:6:5