about summary refs log tree commit diff
path: root/tests/ui/methods
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-09 22:30:26 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-02-10 20:21:39 +0000
commitf0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d (patch)
treee97d87013709bda13934fdc452a2a459a069876a /tests/ui/methods
parent8c04e395952022a451138dc4dbead6dd6ae65203 (diff)
downloadrust-f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d.tar.gz
rust-f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d.zip
Show diff suggestion format on verbose replacement
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --> $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
Diffstat (limited to 'tests/ui/methods')
-rw-r--r--tests/ui/methods/disambiguate-associated-function-first-arg.stderr25
-rw-r--r--tests/ui/methods/disambiguate-multiple-blanket-impl.stderr30
-rw-r--r--tests/ui/methods/disambiguate-multiple-impl.stderr30
-rw-r--r--tests/ui/methods/disambiguate-multiple-trait-2.stderr60
-rw-r--r--tests/ui/methods/disambiguate-multiple-trait.stderr30
-rw-r--r--tests/ui/methods/issues/issue-105732.stderr5
-rw-r--r--tests/ui/methods/issues/issue-90315.stderr5
-rw-r--r--tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr5
-rw-r--r--tests/ui/methods/method-ambig-two-traits-cross-crate.stderr10
-rw-r--r--tests/ui/methods/method-ambig-two-traits-from-bounds.stderr10
-rw-r--r--tests/ui/methods/method-ambig-two-traits-from-impls.stderr10
-rw-r--r--tests/ui/methods/method-ambig-two-traits-from-impls2.stderr10
-rw-r--r--tests/ui/methods/method-ambig-two-traits-with-default-method.stderr10
-rw-r--r--tests/ui/methods/method-ambiguity-no-rcvr.stderr10
-rw-r--r--tests/ui/methods/method-call-err-msg.stderr15
-rw-r--r--tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr15
-rw-r--r--tests/ui/methods/method-not-found-but-doc-alias.stderr5
-rw-r--r--tests/ui/methods/method-on-ambiguous-numeric-type.stderr5
-rw-r--r--tests/ui/methods/suggest-convert-ptr-to-ref.stderr10
19 files changed, 180 insertions, 120 deletions
diff --git a/tests/ui/methods/disambiguate-associated-function-first-arg.stderr b/tests/ui/methods/disambiguate-associated-function-first-arg.stderr
index 341b7a91003..381e29667c8 100644
--- a/tests/ui/methods/disambiguate-associated-function-first-arg.stderr
+++ b/tests/ui/methods/disambiguate-associated-function-first-arg.stderr
@@ -25,16 +25,19 @@ LL |     fn new(_a: Self, _b: i32);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: disambiguate the associated function for candidate #1
    |
-LL |     <A as M>::new(1);
-   |     ~~~~~~~~~~~~~~~~
+LL -     _a.new(1);
+LL +     <A as M>::new(1);
+   |
 help: disambiguate the associated function for candidate #2
    |
-LL |     <A as N>::new(_a, 1);
-   |     ~~~~~~~~~~~~~~~~~~~~
+LL -     _a.new(1);
+LL +     <A as N>::new(_a, 1);
+   |
 help: disambiguate the associated function for candidate #3
    |
-LL |     <A as O>::new(_a, 1);
-   |     ~~~~~~~~~~~~~~~~~~~~
+LL -     _a.new(1);
+LL +     <A as O>::new(_a, 1);
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-associated-function-first-arg.rs:47:7
@@ -54,12 +57,14 @@ LL |     fn f(self) {}
    |     ^^^^^^^^^^
 help: disambiguate the method for candidate #1
    |
-LL |     TraitA::f(S);
-   |     ~~~~~~~~~~~~
+LL -     S.f();
+LL +     TraitA::f(S);
+   |
 help: disambiguate the method for candidate #2
    |
-LL |     TraitB::f(S);
-   |     ~~~~~~~~~~~~
+LL -     S.f();
+LL +     TraitB::f(S);
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr b/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr
index ccdd9a95451..1b81dc5aafb 100644
--- a/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr
+++ b/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr
@@ -6,10 +6,12 @@ LL |     let _: S::Type;
    |
 help: use fully-qualified syntax
    |
-LL |     let _: <S as A>::Type;
-   |            ~~~~~~~~~~~~~~
-LL |     let _: <S as B>::Type;
-   |            ~~~~~~~~~~~~~~
+LL -     let _: S::Type;
+LL +     let _: <S as A>::Type;
+   |
+LL -     let _: S::Type;
+LL +     let _: <S as B>::Type;
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-blanket-impl.rs:30:8
@@ -29,10 +31,12 @@ LL |     fn foo(&self) {}
    |     ^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     A::foo(&s);
-   |     ~~~
-LL |     B::foo(&s);
-   |     ~~~
+LL -     S::foo(&s);
+LL +     A::foo(&s);
+   |
+LL -     S::foo(&s);
+LL +     B::foo(&s);
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-blanket-impl.rs:33:8
@@ -52,10 +56,12 @@ LL |     const CONST: usize = 2;
    |     ^^^^^^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     <S as A>::CONST;
-   |     ~~~~~~~~~~
-LL |     <S as B>::CONST;
-   |     ~~~~~~~~~~
+LL -     S::CONST;
+LL +     <S as A>::CONST;
+   |
+LL -     S::CONST;
+LL +     <S as B>::CONST;
+   |
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/methods/disambiguate-multiple-impl.stderr b/tests/ui/methods/disambiguate-multiple-impl.stderr
index 4172120770c..2563c2327b7 100644
--- a/tests/ui/methods/disambiguate-multiple-impl.stderr
+++ b/tests/ui/methods/disambiguate-multiple-impl.stderr
@@ -6,10 +6,12 @@ LL |     let _: S::Type = ();
    |
 help: use fully-qualified syntax
    |
-LL |     let _: <S as A>::Type = ();
-   |            ~~~~~~~~~~~~~~
-LL |     let _: <S as B>::Type = ();
-   |            ~~~~~~~~~~~~~~
+LL -     let _: S::Type = ();
+LL +     let _: <S as A>::Type = ();
+   |
+LL -     let _: S::Type = ();
+LL +     let _: <S as B>::Type = ();
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-impl.rs:29:8
@@ -29,10 +31,12 @@ LL |     fn foo(&self) {}
    |     ^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     A::foo(&s);
-   |     ~~~
-LL |     B::foo(&s);
-   |     ~~~
+LL -     S::foo(&s);
+LL +     A::foo(&s);
+   |
+LL -     S::foo(&s);
+LL +     B::foo(&s);
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-impl.rs:34:16
@@ -52,10 +56,12 @@ LL |     const CONST: usize = 2;
    |     ^^^^^^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     let _ = <S as A>::CONST;
-   |             ~~~~~~~~~~
-LL |     let _ = <S as B>::CONST;
-   |             ~~~~~~~~~~
+LL -     let _ = S::CONST;
+LL +     let _ = <S as A>::CONST;
+   |
+LL -     let _ = S::CONST;
+LL +     let _ = <S as B>::CONST;
+   |
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/methods/disambiguate-multiple-trait-2.stderr b/tests/ui/methods/disambiguate-multiple-trait-2.stderr
index 2778f254a56..08e264c20c8 100644
--- a/tests/ui/methods/disambiguate-multiple-trait-2.stderr
+++ b/tests/ui/methods/disambiguate-multiple-trait-2.stderr
@@ -12,12 +12,14 @@ LL |     let _: T::Type;
    |
 help: use fully-qualified syntax to disambiguate
    |
-LL |     let _: <T as A>::Type;
-   |            ~~~~~~~~~~
+LL -     let _: T::Type;
+LL +     let _: <T as A>::Type;
+   |
 help: use fully-qualified syntax to disambiguate
    |
-LL |     let _: <T as B>::Type;
-   |            ~~~~~~~~~~
+LL -     let _: T::Type;
+LL +     let _: <T as B>::Type;
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-trait-2.rs:16:7
@@ -37,12 +39,14 @@ LL |     fn foo(&self);
    |     ^^^^^^^^^^^^^^
 help: disambiguate the method for candidate #1
    |
-LL |     A::foo(&t);
-   |     ~~~~~~~~~~
+LL -     t.foo();
+LL +     A::foo(&t);
+   |
 help: disambiguate the method for candidate #2
    |
-LL |     B::foo(&t);
-   |     ~~~~~~~~~~
+LL -     t.foo();
+LL +     B::foo(&t);
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-trait-2.rs:20:16
@@ -62,10 +66,12 @@ LL |     const CONST: usize;
    |     ^^^^^^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     let _ = <T as A>::CONST;
-   |             ~~~~~~~~~~
-LL |     let _ = <T as B>::CONST;
-   |             ~~~~~~~~~~
+LL -     let _ = T::CONST;
+LL +     let _ = <T as A>::CONST;
+   |
+LL -     let _ = T::CONST;
+LL +     let _ = <T as B>::CONST;
+   |
 
 error[E0223]: ambiguous associated type
   --> $DIR/disambiguate-multiple-trait-2.rs:52:12
@@ -75,10 +81,12 @@ LL |     let _: S::Type;
    |
 help: use fully-qualified syntax
    |
-LL |     let _: <S as A>::Type;
-   |            ~~~~~~~~~~~~~~
-LL |     let _: <S as B>::Type;
-   |            ~~~~~~~~~~~~~~
+LL -     let _: S::Type;
+LL +     let _: <S as A>::Type;
+   |
+LL -     let _: S::Type;
+LL +     let _: <S as B>::Type;
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-trait-2.rs:46:8
@@ -98,10 +106,12 @@ LL |     fn foo(&self) {}
    |     ^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     A::foo(&s);
-   |     ~~~
-LL |     B::foo(&s);
-   |     ~~~
+LL -     S::foo(&s);
+LL +     A::foo(&s);
+   |
+LL -     S::foo(&s);
+LL +     B::foo(&s);
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-trait-2.rs:49:16
@@ -121,10 +131,12 @@ LL |     const CONST: usize = 1;
    |     ^^^^^^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     let _ = <S as A>::CONST;
-   |             ~~~~~~~~~~
-LL |     let _ = <S as B>::CONST;
-   |             ~~~~~~~~~~
+LL -     let _ = S::CONST;
+LL +     let _ = <S as A>::CONST;
+   |
+LL -     let _ = S::CONST;
+LL +     let _ = <S as B>::CONST;
+   |
 
 error: aborting due to 6 previous errors
 
diff --git a/tests/ui/methods/disambiguate-multiple-trait.stderr b/tests/ui/methods/disambiguate-multiple-trait.stderr
index e00498ca62b..a977fe2cd03 100644
--- a/tests/ui/methods/disambiguate-multiple-trait.stderr
+++ b/tests/ui/methods/disambiguate-multiple-trait.stderr
@@ -6,10 +6,12 @@ LL |     let _: S::Type;
    |
 help: use fully-qualified syntax
    |
-LL |     let _: <S as A>::Type;
-   |            ~~~~~~~~~~~~~~
-LL |     let _: <S as B>::Type;
-   |            ~~~~~~~~~~~~~~
+LL -     let _: S::Type;
+LL +     let _: <S as A>::Type;
+   |
+LL -     let _: S::Type;
+LL +     let _: <S as B>::Type;
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-trait.rs:24:8
@@ -29,10 +31,12 @@ LL |     fn foo(&self) {}
    |     ^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     A::foo(&s);
-   |     ~~~
-LL |     B::foo(&s);
-   |     ~~~
+LL -     S::foo(&s);
+LL +     A::foo(&s);
+   |
+LL -     S::foo(&s);
+LL +     B::foo(&s);
+   |
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/disambiguate-multiple-trait.rs:27:16
@@ -52,10 +56,12 @@ LL |     const CONST: usize = 2;
    |     ^^^^^^^^^^^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     let _ = <S as A>::CONST;
-   |             ~~~~~~~~~~
-LL |     let _ = <S as B>::CONST;
-   |             ~~~~~~~~~~
+LL -     let _ = S::CONST;
+LL +     let _ = <S as A>::CONST;
+   |
+LL -     let _ = S::CONST;
+LL +     let _ = <S as B>::CONST;
+   |
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/methods/issues/issue-105732.stderr b/tests/ui/methods/issues/issue-105732.stderr
index a4924b3e663..6244f983550 100644
--- a/tests/ui/methods/issues/issue-105732.stderr
+++ b/tests/ui/methods/issues/issue-105732.stderr
@@ -14,8 +14,9 @@ LL |         self.g();
    |
 help: there is a method `f` with a similar name
    |
-LL |         self.f();
-   |              ~
+LL -         self.g();
+LL +         self.f();
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/methods/issues/issue-90315.stderr b/tests/ui/methods/issues/issue-90315.stderr
index 0466bb0a0c9..e194a918834 100644
--- a/tests/ui/methods/issues/issue-90315.stderr
+++ b/tests/ui/methods/issues/issue-90315.stderr
@@ -181,8 +181,9 @@ LL |     let _res: i32 = ..6.take(2).sum();
    |
 help: you must specify a concrete type for this numeric value, like `i32`
    |
-LL |     let _res: i32 = ..6_i32.take(2).sum();
-   |                       ~~~~~
+LL -     let _res: i32 = ..6.take(2).sum();
+LL +     let _res: i32 = ..6_i32.take(2).sum();
+   |
 
 error: aborting due to 18 previous errors
 
diff --git a/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
index b2d2d039ff6..a5f1b76702f 100644
--- a/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
+++ b/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
@@ -25,8 +25,9 @@ LL | impl Foo for Vec<isize> {
    | ^^^^^^^^^^^^^^^^^^^^^^^
 help: try using a fully qualified path to specify the expected types
    |
-LL |     <Vec<T> as Foo>::foo(&x);
-   |     ++++++++++++++++++++++ ~
+LL -     x.foo();
+LL +     <Vec<T> as Foo>::foo(&x);
+   |
 
 error[E0308]: mismatched types
   --> $DIR/method-ambig-one-trait-unknown-int-type.rs:33:20
diff --git a/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr b/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr
index 0fc0c909ea8..707c33c3d94 100644
--- a/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr
@@ -12,12 +12,14 @@ LL | impl Me2 for usize { fn me(&self) -> usize { *self } }
    = note: candidate #2 is defined in an impl of the trait `Me` for the type `usize`
 help: disambiguate the method for candidate #1
    |
-LL | fn main() { Me2::me(&1_usize); }
-   |             ~~~~~~~~~~~~~~~~~
+LL - fn main() { 1_usize.me(); }
+LL + fn main() { Me2::me(&1_usize); }
+   |
 help: disambiguate the method for candidate #2
    |
-LL | fn main() { Me::me(&1_usize); }
-   |             ~~~~~~~~~~~~~~~~
+LL - fn main() { 1_usize.me(); }
+LL + fn main() { Me::me(&1_usize); }
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr b/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr
index 690f979fa37..f3aa1582398 100644
--- a/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr
@@ -16,12 +16,14 @@ LL | trait B { fn foo(&self); }
    |           ^^^^^^^^^^^^^^
 help: disambiguate the method for candidate #1
    |
-LL |     A::foo(&t);
-   |     ~~~~~~~~~~
+LL -     t.foo();
+LL +     A::foo(&t);
+   |
 help: disambiguate the method for candidate #2
    |
-LL |     B::foo(&t);
-   |     ~~~~~~~~~~
+LL -     t.foo();
+LL +     B::foo(&t);
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-ambig-two-traits-from-impls.stderr b/tests/ui/methods/method-ambig-two-traits-from-impls.stderr
index 8be6d6d64f7..d1c50e8b3d0 100644
--- a/tests/ui/methods/method-ambig-two-traits-from-impls.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-from-impls.stderr
@@ -16,12 +16,14 @@ LL |     fn foo(self) {}
    |     ^^^^^^^^^^^^
 help: disambiguate the method for candidate #1
    |
-LL |     A::foo(AB {});
-   |     ~~~~~~~~~~~~~
+LL -     AB {}.foo();
+LL +     A::foo(AB {});
+   |
 help: disambiguate the method for candidate #2
    |
-LL |     B::foo(AB {});
-   |     ~~~~~~~~~~~~~
+LL -     AB {}.foo();
+LL +     B::foo(AB {});
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr b/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr
index 333520847f8..788f1a4c4b3 100644
--- a/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr
@@ -16,10 +16,12 @@ LL |     fn foo() {}
    |     ^^^^^^^^
 help: use fully-qualified syntax to disambiguate
    |
-LL |     <AB as A>::foo();
-   |     ~~~~~~~~~~~
-LL |     <AB as B>::foo();
-   |     ~~~~~~~~~~~
+LL -     AB::foo();
+LL +     <AB as A>::foo();
+   |
+LL -     AB::foo();
+LL +     <AB as B>::foo();
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr b/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr
index b36ef77fb7e..605c2a85b07 100644
--- a/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr
@@ -16,12 +16,14 @@ LL | trait Foo { fn method(&self) {} }
    |             ^^^^^^^^^^^^^^^^
 help: disambiguate the method for candidate #1
    |
-LL |     Bar::method(&1_usize);
-   |     ~~~~~~~~~~~~~~~~~~~~~
+LL -     1_usize.method();
+LL +     Bar::method(&1_usize);
+   |
 help: disambiguate the method for candidate #2
    |
-LL |     Foo::method(&1_usize);
-   |     ~~~~~~~~~~~~~~~~~~~~~
+LL -     1_usize.method();
+LL +     Foo::method(&1_usize);
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-ambiguity-no-rcvr.stderr b/tests/ui/methods/method-ambiguity-no-rcvr.stderr
index 3b6eb07393a..c1a77a99739 100644
--- a/tests/ui/methods/method-ambiguity-no-rcvr.stderr
+++ b/tests/ui/methods/method-ambiguity-no-rcvr.stderr
@@ -20,12 +20,14 @@ LL |     fn foo() {}
    |     ^^^^^^^^
 help: disambiguate the associated function for candidate #1
    |
-LL |     <Qux as Foo>::foo();
-   |     ~~~~~~~~~~~~~~~~~~~
+LL -     Qux.foo();
+LL +     <Qux as Foo>::foo();
+   |
 help: disambiguate the associated function for candidate #2
    |
-LL |     <Qux as FooBar>::foo();
-   |     ~~~~~~~~~~~~~~~~~~~~~~
+LL -     Qux.foo();
+LL +     <Qux as FooBar>::foo();
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-call-err-msg.stderr b/tests/ui/methods/method-call-err-msg.stderr
index c17c4a23a3a..7cda928aca9 100644
--- a/tests/ui/methods/method-call-err-msg.stderr
+++ b/tests/ui/methods/method-call-err-msg.stderr
@@ -28,8 +28,9 @@ LL |     fn one(self, _: isize) -> Foo { self }
    |        ^^^       --------
 help: provide the argument
    |
-LL |      .one(/* isize */)
-   |          ~~~~~~~~~~~~~
+LL -      .one()
+LL +      .one(/* isize */)
+   |
 
 error[E0061]: this method takes 2 arguments but 1 argument was supplied
   --> $DIR/method-call-err-msg.rs:15:7
@@ -44,8 +45,9 @@ LL |     fn two(self, _: isize, _: isize) -> Foo { self }
    |        ^^^                 --------
 help: provide the argument
    |
-LL |      .two(0, /* isize */);
-   |          ~~~~~~~~~~~~~~~~
+LL -      .two(0);
+LL +      .two(0, /* isize */);
+   |
 
 error[E0599]: `Foo` is not an iterator
   --> $DIR/method-call-err-msg.rs:19:7
@@ -82,8 +84,9 @@ LL |     fn three<T>(self, _: T, _: T, _: T) -> Foo { self }
    |        ^^^^^          ----  ----  ----
 help: provide the arguments
    |
-LL |     y.three::<usize>(/* usize */, /* usize */, /* usize */);
-   |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     y.three::<usize>();
+LL +     y.three::<usize>(/* usize */, /* usize */, /* usize */);
+   |
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
index 6159d87c73e..d6da3f2cc39 100644
--- a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
+++ b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
@@ -46,16 +46,19 @@ LL |         fn foo(self: Smaht<Self, u64>) -> u64 {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: disambiguate the method for candidate #1
    |
-LL |     let z = FinalFoo::foo(&x);
-   |             ~~~~~~~~~~~~~~~~~
+LL -     let z = x.foo();
+LL +     let z = FinalFoo::foo(&x);
+   |
 help: disambiguate the method for candidate #2
    |
-LL |     let z = NuisanceFoo::foo(x);
-   |             ~~~~~~~~~~~~~~~~~~~
+LL -     let z = x.foo();
+LL +     let z = NuisanceFoo::foo(x);
+   |
 help: disambiguate the method for candidate #3
    |
-LL |     let z = X::foo(x);
-   |             ~~~~~~~~~
+LL -     let z = x.foo();
+LL +     let z = X::foo(x);
+   |
 
 error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:139:24
diff --git a/tests/ui/methods/method-not-found-but-doc-alias.stderr b/tests/ui/methods/method-not-found-but-doc-alias.stderr
index c49ffa8971f..2164b7cbbf8 100644
--- a/tests/ui/methods/method-not-found-but-doc-alias.stderr
+++ b/tests/ui/methods/method-not-found-but-doc-alias.stderr
@@ -9,8 +9,9 @@ LL |     Foo.quux();
    |
 help: there is a method `bar` with a similar name
    |
-LL |     Foo.bar();
-   |         ~~~
+LL -     Foo.quux();
+LL +     Foo.bar();
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-on-ambiguous-numeric-type.stderr b/tests/ui/methods/method-on-ambiguous-numeric-type.stderr
index 12427040272..d688bcc90c8 100644
--- a/tests/ui/methods/method-on-ambiguous-numeric-type.stderr
+++ b/tests/ui/methods/method-on-ambiguous-numeric-type.stderr
@@ -6,8 +6,9 @@ LL |     let x = 2.0.neg();
    |
 help: you must specify a concrete type for this numeric value, like `f32`
    |
-LL |     let x = 2.0_f32.neg();
-   |             ~~~~~~~
+LL -     let x = 2.0.neg();
+LL +     let x = 2.0_f32.neg();
+   |
 
 error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
   --> $DIR/method-on-ambiguous-numeric-type.rs:17:15
diff --git a/tests/ui/methods/suggest-convert-ptr-to-ref.stderr b/tests/ui/methods/suggest-convert-ptr-to-ref.stderr
index 0e1565e251a..7d52b20121e 100644
--- a/tests/ui/methods/suggest-convert-ptr-to-ref.stderr
+++ b/tests/ui/methods/suggest-convert-ptr-to-ref.stderr
@@ -47,8 +47,9 @@ LL |     let _ = t.as_mut_ref();
    |
 help: there is a method `as_mut` with a similar name
    |
-LL |     let _ = t.as_mut();
-   |               ~~~~~~
+LL -     let _ = t.as_mut_ref();
+LL +     let _ = t.as_mut();
+   |
 
 error[E0599]: no method named `as_ref_mut` found for raw pointer `*mut u8` in the current scope
   --> $DIR/suggest-convert-ptr-to-ref.rs:13:15
@@ -58,8 +59,9 @@ LL |     let _ = t.as_ref_mut();
    |
 help: there is a method `as_mut` with a similar name
    |
-LL |     let _ = t.as_mut();
-   |               ~~~~~~
+LL -     let _ = t.as_ref_mut();
+LL +     let _ = t.as_mut();
+   |
 
 error[E0599]: no method named `make_ascii_lowercase` found for raw pointer `*const u8` in the current scope
   --> $DIR/suggest-convert-ptr-to-ref.rs:16:7