about summary refs log tree commit diff
path: root/tests/ui/compare-method
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/compare-method
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/compare-method')
-rw-r--r--tests/ui/compare-method/bad-self-type.stderr10
-rw-r--r--tests/ui/compare-method/issue-90444.stderr10
-rw-r--r--tests/ui/compare-method/region-extra-2.stderr5
-rw-r--r--tests/ui/compare-method/reordered-type-param.stderr5
4 files changed, 18 insertions, 12 deletions
diff --git a/tests/ui/compare-method/bad-self-type.stderr b/tests/ui/compare-method/bad-self-type.stderr
index a3a31f43447..f662b5a11cb 100644
--- a/tests/ui/compare-method/bad-self-type.stderr
+++ b/tests/ui/compare-method/bad-self-type.stderr
@@ -8,8 +8,9 @@ LL |     fn poll(self, _: &mut Context<'_>) -> Poll<()> {
               found signature `fn(MyFuture, &mut Context<'_>) -> Poll<_>`
 help: change the self-receiver type to match the trait
    |
-LL |     fn poll(self: Pin<&mut MyFuture>, _: &mut Context<'_>) -> Poll<()> {
-   |             ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     fn poll(self, _: &mut Context<'_>) -> Poll<()> {
+LL +     fn poll(self: Pin<&mut MyFuture>, _: &mut Context<'_>) -> Poll<()> {
+   |
 
 error[E0053]: method `foo` has an incompatible type for trait
   --> $DIR/bad-self-type.rs:22:18
@@ -26,8 +27,9 @@ LL |     fn foo(self);
               found signature `fn(Box<MyFuture>)`
 help: change the self-receiver type to match the trait
    |
-LL |     fn foo(self) {}
-   |            ~~~~
+LL -     fn foo(self: Box<Self>) {}
+LL +     fn foo(self) {}
+   |
 
 error[E0053]: method `bar` has an incompatible type for trait
   --> $DIR/bad-self-type.rs:24:17
diff --git a/tests/ui/compare-method/issue-90444.stderr b/tests/ui/compare-method/issue-90444.stderr
index f05c9939c00..c69d63b3e30 100644
--- a/tests/ui/compare-method/issue-90444.stderr
+++ b/tests/ui/compare-method/issue-90444.stderr
@@ -8,8 +8,9 @@ LL |     fn from(_: fn((), (), &mut ())) -> Self {
               found signature `fn(for<'a> fn((), (), &'a mut ())) -> A`
 help: change the parameter type to match the trait
    |
-LL |     fn from(_: for<'a> fn((), (), &'a ())) -> Self {
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     fn from(_: fn((), (), &mut ())) -> Self {
+LL +     fn from(_: for<'a> fn((), (), &'a ())) -> Self {
+   |
 
 error[E0053]: method `from` has an incompatible type for trait
   --> $DIR/issue-90444.rs:11:16
@@ -21,8 +22,9 @@ LL |     fn from(_: fn((), (), u64)) -> Self {
               found signature `fn(fn((), (), u64)) -> B`
 help: change the parameter type to match the trait
    |
-LL |     fn from(_: fn((), (), u32)) -> Self {
-   |                ~~~~~~~~~~~~~~~
+LL -     fn from(_: fn((), (), u64)) -> Self {
+LL +     fn from(_: fn((), (), u32)) -> Self {
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/compare-method/region-extra-2.stderr b/tests/ui/compare-method/region-extra-2.stderr
index 3f55f673117..d19d4f28f12 100644
--- a/tests/ui/compare-method/region-extra-2.stderr
+++ b/tests/ui/compare-method/region-extra-2.stderr
@@ -9,8 +9,9 @@ LL |     fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
    |
 help: copy the `where` clause predicates from the trait
    |
-LL |     fn renew<'b: 'a>(self) -> &'b mut [T] where 'b: 'a {
-   |                                           ~~~~~~~~~~~~
+LL -     fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
+LL +     fn renew<'b: 'a>(self) -> &'b mut [T] where 'b: 'a {
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/compare-method/reordered-type-param.stderr b/tests/ui/compare-method/reordered-type-param.stderr
index 1e8266e213d..536364871a3 100644
--- a/tests/ui/compare-method/reordered-type-param.stderr
+++ b/tests/ui/compare-method/reordered-type-param.stderr
@@ -18,8 +18,9 @@ LL |   fn b<C:Clone,D>(&self, x: C) -> C;
    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
 help: change the parameter type to match the trait
    |
-LL |   fn b<F:Clone,G>(&self, _x: F) -> G { panic!() }
-   |                              ~
+LL -   fn b<F:Clone,G>(&self, _x: G) -> G { panic!() }
+LL +   fn b<F:Clone,G>(&self, _x: F) -> G { panic!() }
+   |
 
 error: aborting due to 1 previous error