about summary refs log tree commit diff
path: root/tests/ui/self
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/self
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/self')
-rw-r--r--tests/ui/self/arbitrary_self_type_mut_difference.stderr10
-rw-r--r--tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr10
-rw-r--r--tests/ui/self/self-infer.stderr10
3 files changed, 18 insertions, 12 deletions
diff --git a/tests/ui/self/arbitrary_self_type_mut_difference.stderr b/tests/ui/self/arbitrary_self_type_mut_difference.stderr
index ffc61ee0d78..31c1c9b7382 100644
--- a/tests/ui/self/arbitrary_self_type_mut_difference.stderr
+++ b/tests/ui/self/arbitrary_self_type_mut_difference.stderr
@@ -11,8 +11,9 @@ LL |     fn x(self: Pin<&mut Self>) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: there is a method `y` with a similar name
    |
-LL |     Pin::new(&S).y();
-   |                  ~
+LL -     Pin::new(&S).x();
+LL +     Pin::new(&S).y();
+   |
 
 error[E0599]: no method named `y` found for struct `Pin<&mut S>` in the current scope
   --> $DIR/arbitrary_self_type_mut_difference.rs:12:22
@@ -27,8 +28,9 @@ LL |     fn y(self: Pin<&Self>) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^
 help: there is a method `x` with a similar name
    |
-LL |     Pin::new(&mut S).x();
-   |                      ~
+LL -     Pin::new(&mut S).y();
+LL +     Pin::new(&mut S).x();
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr
index 4c0ab88493e..8843efc6ff8 100644
--- a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr
+++ b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr
@@ -13,8 +13,9 @@ LL |     foo_cpp_ref.0.frobnicate_ref();
    |                 ++
 help: there is a method `frobnicate_cpp_ref` with a similar name
    |
-LL |     foo_cpp_ref.frobnicate_cpp_ref();
-   |                 ~~~~~~~~~~~~~~~~~~
+LL -     foo_cpp_ref.frobnicate_ref();
+LL +     foo_cpp_ref.frobnicate_cpp_ref();
+   |
 
 error[E0599]: no method named `frobnicate_self` found for struct `CppRef` in the current scope
   --> $DIR/arbitrary_self_types_not_allow_call_with_no_deref.rs:32:17
@@ -31,8 +32,9 @@ LL |     foo_cpp_ref.0.frobnicate_self(); // would desugar to `Foo::frobnicate_s
    |                 ++
 help: there is a method `frobnicate_cpp_ref` with a similar name
    |
-LL |     foo_cpp_ref.frobnicate_cpp_ref(); // would desugar to `Foo::frobnicate_self(*foo_cpp_ref)`
-   |                 ~~~~~~~~~~~~~~~~~~
+LL -     foo_cpp_ref.frobnicate_self(); // would desugar to `Foo::frobnicate_self(*foo_cpp_ref)`
+LL +     foo_cpp_ref.frobnicate_cpp_ref(); // would desugar to `Foo::frobnicate_self(*foo_cpp_ref)`
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/self/self-infer.stderr b/tests/ui/self/self-infer.stderr
index 4f9e3f21dca..c6bdff22b69 100644
--- a/tests/ui/self/self-infer.stderr
+++ b/tests/ui/self/self-infer.stderr
@@ -6,8 +6,9 @@ LL |     fn f(self: _) {}
    |
 help: use type parameters instead
    |
-LL |     fn f<T>(self: T) {}
-   |         +++       ~
+LL -     fn f(self: _) {}
+LL +     fn f<T>(self: T) {}
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
   --> $DIR/self-infer.rs:5:17
@@ -17,8 +18,9 @@ LL |     fn g(self: &_) {}
    |
 help: use type parameters instead
    |
-LL |     fn g<T>(self: &T) {}
-   |         +++        ~
+LL -     fn g(self: &_) {}
+LL +     fn g<T>(self: &T) {}
+   |
 
 error: aborting due to 2 previous errors