about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-02-01 17:44:48 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-02-14 20:22:10 +0000
commitbd176ee591cd391835bfbcb3409a743bac2128ca (patch)
tree43ff75755e5c815c5085ed330a14c1e18b6fc297
parent5d63e10318ea76efc4d4d6a33cf1f74c9839adfb (diff)
downloadrust-bd176ee591cd391835bfbcb3409a743bac2128ca.tar.gz
rust-bd176ee591cd391835bfbcb3409a743bac2128ca.zip
Make removal suggestion not verbose
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs2
-rw-r--r--tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr11
-rw-r--r--tests/ui/argument-suggestions/basic.stderr10
-rw-r--r--tests/ui/argument-suggestions/exotic-calls.stderr40
-rw-r--r--tests/ui/argument-suggestions/extra_arguments.stderr129
-rw-r--r--tests/ui/error-codes/E0057.stderr10
-rw-r--r--tests/ui/issues/issue-16939.stderr10
-rw-r--r--tests/ui/issues/issue-26094.stderr10
-rw-r--r--tests/ui/issues/issue-4935.stderr10
-rw-r--r--tests/ui/methods/method-call-err-msg.stderr10
-rw-r--r--tests/ui/resolve/resolve-primitive-fallback.stderr10
-rw-r--r--tests/ui/span/issue-34264.stderr20
-rw-r--r--tests/ui/tuple/wrong_argument_ice-4.stderr10
-rw-r--r--tests/ui/type/type-ascription-instead-of-initializer.stderr10
-rw-r--r--tests/ui/typeck/remove-extra-argument.stderr10
-rw-r--r--tests/ui/typeck/struct-enum-wrong-args.stderr30
16 files changed, 136 insertions, 196 deletions
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
index 21f236db7dc..005225b665c 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
@@ -1167,7 +1167,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 Some(format!("provide the argument{}", if plural { "s" } else { "" }))
             }
             SuggestionText::Remove(plural) => {
-                err.multipart_suggestion_verbose(
+                err.multipart_suggestion(
                     &format!("remove the extra argument{}", if plural { "s" } else { "" }),
                     suggestions,
                     Applicability::HasPlaceholders,
diff --git a/tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr b/tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr
index 9f568f86970..d1b9d7a40b4 100644
--- a/tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr
+++ b/tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr
@@ -7,7 +7,10 @@ LL |   fn oom() -> ! {
    |  _-^^^^^^^^^^^^
 LL | |     loop {}
 LL | | }
-   | |_- unexpected argument of type `core::alloc::Layout`
+   | | -
+   | | |
+   | |_unexpected argument of type `core::alloc::Layout`
+   |   help: remove the extra argument
    |
 note: function defined here
   --> $DIR/alloc-error-handler-bad-signature-3.rs:10:4
@@ -15,12 +18,6 @@ note: function defined here
 LL | fn oom() -> ! {
    |    ^^^
    = note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: remove the extra argument
-   |
-LL - fn oom() -> ! {
-LL -     loop {}
-LL - }
-   |
 
 error: aborting due to previous error
 
diff --git a/tests/ui/argument-suggestions/basic.stderr b/tests/ui/argument-suggestions/basic.stderr
index ea58ca97cfa..c74186285f9 100644
--- a/tests/ui/argument-suggestions/basic.stderr
+++ b/tests/ui/argument-suggestions/basic.stderr
@@ -16,18 +16,16 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/basic.rs:21:5
    |
 LL |     extra("");
-   |     ^^^^^ -- unexpected argument of type `&'static str`
+   |     ^^^^^ --
+   |           |
+   |           unexpected argument of type `&'static str`
+   |           help: remove the extra argument
    |
 note: function defined here
   --> $DIR/basic.rs:14:4
    |
 LL | fn extra() {}
    |    ^^^^^
-help: remove the extra argument
-   |
-LL -     extra("");
-LL +     extra();
-   |
 
 error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/basic.rs:22:5
diff --git a/tests/ui/argument-suggestions/exotic-calls.stderr b/tests/ui/argument-suggestions/exotic-calls.stderr
index aca3b8a3433..ff795b507f2 100644
--- a/tests/ui/argument-suggestions/exotic-calls.stderr
+++ b/tests/ui/argument-suggestions/exotic-calls.stderr
@@ -2,69 +2,61 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/exotic-calls.rs:2:5
    |
 LL |     t(1i32);
-   |     ^ ---- unexpected argument of type `i32`
+   |     ^ ----
+   |       |
+   |       unexpected argument of type `i32`
+   |       help: remove the extra argument
    |
 note: callable defined here
   --> $DIR/exotic-calls.rs:1:11
    |
 LL | fn foo<T: Fn()>(t: T) {
    |           ^^^^
-help: remove the extra argument
-   |
-LL -     t(1i32);
-LL +     t();
-   |
 
 error[E0057]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/exotic-calls.rs:7:5
    |
 LL |     t(1i32);
-   |     ^ ---- unexpected argument of type `i32`
+   |     ^ ----
+   |       |
+   |       unexpected argument of type `i32`
+   |       help: remove the extra argument
    |
 note: type parameter defined here
   --> $DIR/exotic-calls.rs:6:11
    |
 LL | fn bar(t: impl Fn()) {
    |           ^^^^^^^^^
-help: remove the extra argument
-   |
-LL -     t(1i32);
-LL +     t();
-   |
 
 error[E0057]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/exotic-calls.rs:16:5
    |
 LL |     baz()(1i32)
-   |     ^^^^^ ---- unexpected argument of type `i32`
+   |     ^^^^^ ----
+   |           |
+   |           unexpected argument of type `i32`
+   |           help: remove the extra argument
    |
 note: opaque type defined here
   --> $DIR/exotic-calls.rs:11:13
    |
 LL | fn baz() -> impl Fn() {
    |             ^^^^^^^^^
-help: remove the extra argument
-   |
-LL -     baz()(1i32)
-LL +     baz()()
-   |
 
 error[E0057]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/exotic-calls.rs:22:5
    |
 LL |     x(1i32);
-   |     ^ ---- unexpected argument of type `i32`
+   |     ^ ----
+   |       |
+   |       unexpected argument of type `i32`
+   |       help: remove the extra argument
    |
 note: closure defined here
   --> $DIR/exotic-calls.rs:21:13
    |
 LL |     let x = || {};
    |             ^^
-help: remove the extra argument
-   |
-LL -     x(1i32);
-LL +     x();
-   |
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/argument-suggestions/extra_arguments.stderr b/tests/ui/argument-suggestions/extra_arguments.stderr
index 34e849e85cc..0911685b428 100644
--- a/tests/ui/argument-suggestions/extra_arguments.stderr
+++ b/tests/ui/argument-suggestions/extra_arguments.stderr
@@ -2,52 +2,46 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/extra_arguments.rs:7:3
    |
 LL |   empty("");
-   |   ^^^^^ -- unexpected argument of type `&'static str`
+   |   ^^^^^ --
+   |         |
+   |         unexpected argument of type `&'static str`
+   |         help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:1:4
    |
 LL | fn empty() {}
    |    ^^^^^
-help: remove the extra argument
-   |
-LL -   empty("");
-LL +   empty();
-   |
 
 error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/extra_arguments.rs:9:3
    |
 LL |   one_arg(1, 1);
-   |   ^^^^^^^    - unexpected argument of type `{integer}`
+   |   ^^^^^^^  ---
+   |            | |
+   |            | unexpected argument of type `{integer}`
+   |            help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:2:4
    |
 LL | fn one_arg(_a: i32) {}
    |    ^^^^^^^ -------
-help: remove the extra argument
-   |
-LL -   one_arg(1, 1);
-LL +   one_arg(1);
-   |
 
 error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/extra_arguments.rs:10:3
    |
 LL |   one_arg(1, "");
-   |   ^^^^^^^    -- unexpected argument of type `&'static str`
+   |   ^^^^^^^  ----
+   |            | |
+   |            | unexpected argument of type `&'static str`
+   |            help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:2:4
    |
 LL | fn one_arg(_a: i32) {}
    |    ^^^^^^^ -------
-help: remove the extra argument
-   |
-LL -   one_arg(1, "");
-LL +   one_arg(1);
-   |
 
 error[E0061]: this function takes 1 argument but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:11:3
@@ -72,69 +66,61 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:13:3
    |
 LL |   two_arg_same(1, 1, 1);
-   |   ^^^^^^^^^^^^       - unexpected argument of type `{integer}`
+   |   ^^^^^^^^^^^^     ---
+   |                    | |
+   |                    | unexpected argument of type `{integer}`
+   |                    help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:3:4
    |
 LL | fn two_arg_same(_a: i32, _b: i32) {}
    |    ^^^^^^^^^^^^ -------  -------
-help: remove the extra argument
-   |
-LL -   two_arg_same(1, 1, 1);
-LL +   two_arg_same(1, 1);
-   |
 
 error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:14:3
    |
 LL |   two_arg_same(1, 1, 1.0);
-   |   ^^^^^^^^^^^^       --- unexpected argument of type `{float}`
+   |   ^^^^^^^^^^^^     -----
+   |                    | |
+   |                    | unexpected argument of type `{float}`
+   |                    help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:3:4
    |
 LL | fn two_arg_same(_a: i32, _b: i32) {}
    |    ^^^^^^^^^^^^ -------  -------
-help: remove the extra argument
-   |
-LL -   two_arg_same(1, 1, 1.0);
-LL +   two_arg_same(1, 1);
-   |
 
 error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:16:3
    |
 LL |   two_arg_diff(1, 1, "");
-   |   ^^^^^^^^^^^^    - unexpected argument of type `{integer}`
+   |   ^^^^^^^^^^^^  ---
+   |                 | |
+   |                 | unexpected argument of type `{integer}`
+   |                 help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:4:4
    |
 LL | fn two_arg_diff(_a: i32, _b: &str) {}
    |    ^^^^^^^^^^^^ -------  --------
-help: remove the extra argument
-   |
-LL -   two_arg_diff(1, 1, "");
-LL +   two_arg_diff(1, "");
-   |
 
 error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:17:3
    |
 LL |   two_arg_diff(1, "", "");
-   |   ^^^^^^^^^^^^        -- unexpected argument of type `&'static str`
+   |   ^^^^^^^^^^^^      ----
+   |                     | |
+   |                     | unexpected argument of type `&'static str`
+   |                     help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:4:4
    |
 LL | fn two_arg_diff(_a: i32, _b: &str) {}
    |    ^^^^^^^^^^^^ -------  --------
-help: remove the extra argument
-   |
-LL -   two_arg_diff(1, "", "");
-LL +   two_arg_diff(1, "");
-   |
 
 error[E0061]: this function takes 2 arguments but 4 arguments were supplied
   --> $DIR/extra_arguments.rs:18:3
@@ -178,75 +164,70 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:22:3
    |
 LL |   two_arg_same(1, 1,     "");
-   |   ^^^^^^^^^^^^           -- unexpected argument of type `&'static str`
+   |   ^^^^^^^^^^^^     --------
+   |                    |     |
+   |                    |     unexpected argument of type `&'static str`
+   |                    help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:3:4
    |
 LL | fn two_arg_same(_a: i32, _b: i32) {}
    |    ^^^^^^^^^^^^ -------  -------
-help: remove the extra argument
-   |
-LL -   two_arg_same(1, 1,     "");
-LL +   two_arg_same(1, 1);
-   |
 
 error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:23:3
    |
 LL |   two_arg_diff(1, 1,     "");
-   |   ^^^^^^^^^^^^    - unexpected argument of type `{integer}`
+   |   ^^^^^^^^^^^^  ---
+   |                 | |
+   |                 | unexpected argument of type `{integer}`
+   |                 help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:4:4
    |
 LL | fn two_arg_diff(_a: i32, _b: &str) {}
    |    ^^^^^^^^^^^^ -------  --------
-help: remove the extra argument
-   |
-LL -   two_arg_diff(1, 1,     "");
-LL +   two_arg_diff(1,     "");
-   |
 
 error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:24:3
    |
-LL |   two_arg_same(
-   |   ^^^^^^^^^^^^
-...
-LL |     ""
-   |     -- unexpected argument of type `&'static str`
+LL |     two_arg_same(
+   |     ^^^^^^^^^^^^
+LL |       1,
+LL |       1,
+   |  ______-
+LL | |     ""
+   | |     --
+   | |_____||
+   |       |help: remove the extra argument
+   |       unexpected argument of type `&'static str`
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:3:4
    |
 LL | fn two_arg_same(_a: i32, _b: i32) {}
    |    ^^^^^^^^^^^^ -------  -------
-help: remove the extra argument
-   |
-LL -     1,
-LL +     1
-   |
 
 error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/extra_arguments.rs:30:3
    |
-LL |   two_arg_diff(
-   |   ^^^^^^^^^^^^
-LL |     1,
-LL |     1,
-   |     - unexpected argument of type `{integer}`
+LL |     two_arg_diff(
+   |     ^^^^^^^^^^^^
+LL |       1,
+   |  ______-
+LL | |     1,
+   | |     -
+   | |     |
+   | |_____unexpected argument of type `{integer}`
+   |       help: remove the extra argument
    |
 note: function defined here
   --> $DIR/extra_arguments.rs:4:4
    |
 LL | fn two_arg_diff(_a: i32, _b: &str) {}
    |    ^^^^^^^^^^^^ -------  --------
-help: remove the extra argument
-   |
-LL -     1,
-LL +     1,
-   |
 
 error: aborting due to 14 previous errors
 
diff --git a/tests/ui/error-codes/E0057.stderr b/tests/ui/error-codes/E0057.stderr
index efd2af6d609..9b0cf069824 100644
--- a/tests/ui/error-codes/E0057.stderr
+++ b/tests/ui/error-codes/E0057.stderr
@@ -18,18 +18,16 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/E0057.rs:5:13
    |
 LL |     let c = f(2, 3);
-   |             ^    - unexpected argument of type `{integer}`
+   |             ^  ---
+   |                | |
+   |                | unexpected argument of type `{integer}`
+   |                help: remove the extra argument
    |
 note: closure defined here
   --> $DIR/E0057.rs:2:13
    |
 LL |     let f = |x| x * 3;
    |             ^^^
-help: remove the extra argument
-   |
-LL -     let c = f(2, 3);
-LL +     let c = f(2);
-   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/issues/issue-16939.stderr b/tests/ui/issues/issue-16939.stderr
index 50c502c527e..6db29bc61b1 100644
--- a/tests/ui/issues/issue-16939.stderr
+++ b/tests/ui/issues/issue-16939.stderr
@@ -2,18 +2,16 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/issue-16939.rs:5:9
    |
 LL |     |t| f(t);
-   |         ^ - unexpected argument
+   |         ^ -
+   |           |
+   |           unexpected argument
+   |           help: remove the extra argument
    |
 note: callable defined here
   --> $DIR/issue-16939.rs:4:12
    |
 LL | fn _foo<F: Fn()> (f: F) {
    |            ^^^^
-help: remove the extra argument
-   |
-LL -     |t| f(t);
-LL +     |t| f();
-   |
 
 error: aborting due to previous error
 
diff --git a/tests/ui/issues/issue-26094.stderr b/tests/ui/issues/issue-26094.stderr
index 074cf31dda6..608d2c7aff9 100644
--- a/tests/ui/issues/issue-26094.stderr
+++ b/tests/ui/issues/issue-26094.stderr
@@ -2,7 +2,10 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/issue-26094.rs:10:17
    |
 LL |         $other(None)
-   |                ---- unexpected argument of type `Option<_>`
+   |                ----
+   |                |
+   |                unexpected argument of type `Option<_>`
+   |                help: remove the extra argument
 ...
 LL |     some_macro!(some_function);
    |                 ^^^^^^^^^^^^^
@@ -12,11 +15,6 @@ note: function defined here
    |
 LL | fn some_function() {}
    |    ^^^^^^^^^^^^^
-help: remove the extra argument
-   |
-LL -         $other(None)
-LL +         $other()
-   |
 
 error: aborting due to previous error
 
diff --git a/tests/ui/issues/issue-4935.stderr b/tests/ui/issues/issue-4935.stderr
index 2853fd9b7fb..e544e424403 100644
--- a/tests/ui/issues/issue-4935.stderr
+++ b/tests/ui/issues/issue-4935.stderr
@@ -2,18 +2,16 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/issue-4935.rs:5:13
    |
 LL | fn main() { foo(5, 6) }
-   |             ^^^    - unexpected argument of type `{integer}`
+   |             ^^^  ---
+   |                  | |
+   |                  | unexpected argument of type `{integer}`
+   |                  help: remove the extra argument
    |
 note: function defined here
   --> $DIR/issue-4935.rs:3:4
    |
 LL | fn foo(a: usize) {}
    |    ^^^ --------
-help: remove the extra argument
-   |
-LL - fn main() { foo(5, 6) }
-LL + fn main() { foo(5) }
-   |
 
 error: aborting due to previous error
 
diff --git a/tests/ui/methods/method-call-err-msg.stderr b/tests/ui/methods/method-call-err-msg.stderr
index e33efac938a..0f37e8f09a9 100644
--- a/tests/ui/methods/method-call-err-msg.stderr
+++ b/tests/ui/methods/method-call-err-msg.stderr
@@ -2,18 +2,16 @@ error[E0061]: this method takes 0 arguments but 1 argument was supplied
   --> $DIR/method-call-err-msg.rs:13:7
    |
 LL |     x.zero(0)
-   |       ^^^^ - unexpected argument of type `{integer}`
+   |       ^^^^ -
+   |            |
+   |            unexpected argument of type `{integer}`
+   |            help: remove the extra argument
    |
 note: associated function defined here
   --> $DIR/method-call-err-msg.rs:5:8
    |
 LL |     fn zero(self) -> Foo { self }
    |        ^^^^
-help: remove the extra argument
-   |
-LL -     x.zero(0)
-LL +     x.zero()
-   |
 
 error[E0061]: this method takes 1 argument but 0 arguments were supplied
   --> $DIR/method-call-err-msg.rs:14:7
diff --git a/tests/ui/resolve/resolve-primitive-fallback.stderr b/tests/ui/resolve/resolve-primitive-fallback.stderr
index 0477faad46f..f803f9da2af 100644
--- a/tests/ui/resolve/resolve-primitive-fallback.stderr
+++ b/tests/ui/resolve/resolve-primitive-fallback.stderr
@@ -24,15 +24,13 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/resolve-primitive-fallback.rs:3:5
    |
 LL |     std::mem::size_of(u16);
-   |     ^^^^^^^^^^^^^^^^^ --- unexpected argument
+   |     ^^^^^^^^^^^^^^^^^ ---
+   |                       |
+   |                       unexpected argument
+   |                       help: remove the extra argument
    |
 note: function defined here
   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
-help: remove the extra argument
-   |
-LL -     std::mem::size_of(u16);
-LL +     std::mem::size_of();
-   |
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/span/issue-34264.stderr b/tests/ui/span/issue-34264.stderr
index 89c67719b5a..f0dea66f612 100644
--- a/tests/ui/span/issue-34264.stderr
+++ b/tests/ui/span/issue-34264.stderr
@@ -54,18 +54,16 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/issue-34264.rs:7:5
    |
 LL |     foo(Some(42), 2, "");
-   |     ^^^              -- unexpected argument of type `&'static str`
+   |     ^^^            ----
+   |                    | |
+   |                    | unexpected argument of type `&'static str`
+   |                    help: remove the extra argument
    |
 note: function defined here
   --> $DIR/issue-34264.rs:1:4
    |
 LL | fn foo(Option<i32>, String) {}
    |    ^^^ -----------  ------
-help: remove the extra argument
-   |
-LL -     foo(Some(42), 2, "");
-LL +     foo(Some(42), 2);
-   |
 
 error[E0308]: mismatched types
   --> $DIR/issue-34264.rs:8:13
@@ -85,18 +83,16 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/issue-34264.rs:10:5
    |
 LL |     bar(1, 2, 3);
-   |     ^^^       - unexpected argument of type `{integer}`
+   |     ^^^     ---
+   |             | |
+   |             | unexpected argument of type `{integer}`
+   |             help: remove the extra argument
    |
 note: function defined here
   --> $DIR/issue-34264.rs:3:4
    |
 LL | fn bar(x, y: usize) {}
    |    ^^^ -  --------
-help: remove the extra argument
-   |
-LL -     bar(1, 2, 3);
-LL +     bar(1, 2);
-   |
 
 error: aborting due to 6 previous errors
 
diff --git a/tests/ui/tuple/wrong_argument_ice-4.stderr b/tests/ui/tuple/wrong_argument_ice-4.stderr
index f2e3b416545..d8569ebf6b6 100644
--- a/tests/ui/tuple/wrong_argument_ice-4.stderr
+++ b/tests/ui/tuple/wrong_argument_ice-4.stderr
@@ -6,18 +6,16 @@ LL |       (|| {})(|| {
 LL | |
 LL | |         let b = 1;
 LL | |     });
-   | |_____- unexpected argument of type `[closure@$DIR/wrong_argument_ice-4.rs:2:13: 2:15]`
+   | |     -
+   | |     |
+   | |_____unexpected argument of type `[closure@$DIR/wrong_argument_ice-4.rs:2:13: 2:15]`
+   |       help: remove the extra argument
    |
 note: closure defined here
   --> $DIR/wrong_argument_ice-4.rs:2:6
    |
 LL |     (|| {})(|| {
    |      ^^
-help: remove the extra argument
-   |
-LL -     (|| {})(|| {
-LL +     (|| {})();
-   |
 
 error: aborting due to previous error
 
diff --git a/tests/ui/type/type-ascription-instead-of-initializer.stderr b/tests/ui/type/type-ascription-instead-of-initializer.stderr
index 6c5447a62ea..429501c2762 100644
--- a/tests/ui/type/type-ascription-instead-of-initializer.stderr
+++ b/tests/ui/type/type-ascription-instead-of-initializer.stderr
@@ -11,15 +11,13 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/type-ascription-instead-of-initializer.rs:2:12
    |
 LL |     let x: Vec::with_capacity(10, 20);
-   |            ^^^^^^^^^^^^^^^^^^     -- unexpected argument of type `{integer}`
+   |            ^^^^^^^^^^^^^^^^^^   ----
+   |                                 | |
+   |                                 | unexpected argument of type `{integer}`
+   |                                 help: remove the extra argument
    |
 note: associated function defined here
   --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-help: remove the extra argument
-   |
-LL -     let x: Vec::with_capacity(10, 20);
-LL +     let x: Vec::with_capacity(10);
-   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/typeck/remove-extra-argument.stderr b/tests/ui/typeck/remove-extra-argument.stderr
index 32a4d0ac722..72ddebab486 100644
--- a/tests/ui/typeck/remove-extra-argument.stderr
+++ b/tests/ui/typeck/remove-extra-argument.stderr
@@ -2,18 +2,16 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/remove-extra-argument.rs:6:5
    |
 LL |     l(vec![], vec![])
-   |     ^         ------ unexpected argument of type `Vec<_>`
+   |     ^       --------
+   |             | |
+   |             | unexpected argument of type `Vec<_>`
+   |             help: remove the extra argument
    |
 note: function defined here
   --> $DIR/remove-extra-argument.rs:3:4
    |
 LL | fn l(_a: Vec<u8>) {}
    |    ^ -----------
-help: remove the extra argument
-   |
-LL -     l(vec![], vec![])
-LL +     l(vec![])
-   |
 
 error: aborting due to previous error
 
diff --git a/tests/ui/typeck/struct-enum-wrong-args.stderr b/tests/ui/typeck/struct-enum-wrong-args.stderr
index d005eca841e..57cbd1d2005 100644
--- a/tests/ui/typeck/struct-enum-wrong-args.stderr
+++ b/tests/ui/typeck/struct-enum-wrong-args.stderr
@@ -2,15 +2,13 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:6:13
    |
 LL |     let _ = Some(3, 2);
-   |             ^^^^    - unexpected argument of type `{integer}`
+   |             ^^^^  ---
+   |                   | |
+   |                   | unexpected argument of type `{integer}`
+   |                   help: remove the extra argument
    |
 note: tuple variant defined here
   --> $SRC_DIR/core/src/option.rs:LL:COL
-help: remove the extra argument
-   |
-LL -     let _ = Some(3, 2);
-LL +     let _ = Some(3);
-   |
 
 error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:7:13
@@ -61,18 +59,16 @@ error[E0061]: this struct takes 1 argument but 2 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:10:13
    |
 LL |     let _ = Wrapper(5, 2);
-   |             ^^^^^^^    - unexpected argument of type `{integer}`
+   |             ^^^^^^^  ---
+   |                      | |
+   |                      | unexpected argument of type `{integer}`
+   |                      help: remove the extra argument
    |
 note: tuple struct defined here
   --> $DIR/struct-enum-wrong-args.rs:2:8
    |
 LL | struct Wrapper(i32);
    |        ^^^^^^^
-help: remove the extra argument
-   |
-LL -     let _ = Wrapper(5, 2);
-LL +     let _ = Wrapper(5);
-   |
 
 error[E0061]: this struct takes 2 arguments but 0 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:11:13
@@ -110,18 +106,16 @@ error[E0061]: this struct takes 2 arguments but 3 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:13:13
    |
 LL |     let _ = DoubleWrapper(5, 2, 7);
-   |             ^^^^^^^^^^^^^       - unexpected argument of type `{integer}`
+   |             ^^^^^^^^^^^^^     ---
+   |                               | |
+   |                               | unexpected argument of type `{integer}`
+   |                               help: remove the extra argument
    |
 note: tuple struct defined here
   --> $DIR/struct-enum-wrong-args.rs:3:8
    |
 LL | struct DoubleWrapper(i32, i32);
    |        ^^^^^^^^^^^^^
-help: remove the extra argument
-   |
-LL -     let _ = DoubleWrapper(5, 2, 7);
-LL +     let _ = DoubleWrapper(5, 2);
-   |
 
 error: aborting due to 8 previous errors