about summary refs log tree commit diff
path: root/tests/ui/issues
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-07-05 23:23:36 -0700
committerGitHub <noreply@github.com>2024-07-05 23:23:36 -0700
commit853148752f0231ba7a7259e95260c361f84c79d1 (patch)
tree8dc09dfc448a337061976e8d327f0a2284baf5c5 /tests/ui/issues
parentd0f61ce214ec5799826d1de2a7e6f0cb55506014 (diff)
parent75692056e1ab8ca8a5e0c8e2def4cabcf2f3b445 (diff)
downloadrust-853148752f0231ba7a7259e95260c361f84c79d1.tar.gz
rust-853148752f0231ba7a7259e95260c361f84c79d1.zip
Rollup merge of #127392 - estebank:arg-type, r=jieyouxu
Use verbose suggestion for changing arg type
Diffstat (limited to 'tests/ui/issues')
-rw-r--r--tests/ui/issues/issue-20225.stderr27
-rw-r--r--tests/ui/issues/issue-21332.stderr9
2 files changed, 20 insertions, 16 deletions
diff --git a/tests/ui/issues/issue-20225.stderr b/tests/ui/issues/issue-20225.stderr
index 2d24a5bbd50..7d6b09cf7f8 100644
--- a/tests/ui/issues/issue-20225.stderr
+++ b/tests/ui/issues/issue-20225.stderr
@@ -4,13 +4,14 @@ error[E0053]: method `call` has an incompatible type for trait
 LL | impl<'a, T> Fn<(&'a T,)> for Foo {
    |          - found this type parameter
 LL |   extern "rust-call" fn call(&self, (_,): (T,)) {}
-   |                                           ^^^^
-   |                                           |
-   |                                           expected `&'a T`, found type parameter `T`
-   |                                           help: change the parameter type to match the trait: `(&'a T,)`
+   |                                           ^^^^ expected `&'a T`, found type parameter `T`
    |
    = note: expected signature `extern "rust-call" fn(&Foo, (&'a _,))`
               found signature `extern "rust-call" fn(&Foo, (_,))`
+help: change the parameter type to match the trait
+   |
+LL |   extern "rust-call" fn call(&self, (_,): (&'a T,)) {}
+   |                                           ~~~~~~~~
 
 error[E0053]: method `call_mut` has an incompatible type for trait
   --> $DIR/issue-20225.rs:11:51
@@ -18,13 +19,14 @@ error[E0053]: method `call_mut` has an incompatible type for trait
 LL | impl<'a, T> FnMut<(&'a T,)> for Foo {
    |          - found this type parameter
 LL |   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
-   |                                                   ^^^^
-   |                                                   |
-   |                                                   expected `&'a T`, found type parameter `T`
-   |                                                   help: change the parameter type to match the trait: `(&'a T,)`
+   |                                                   ^^^^ expected `&'a T`, found type parameter `T`
    |
    = note: expected signature `extern "rust-call" fn(&mut Foo, (&'a _,))`
               found signature `extern "rust-call" fn(&mut Foo, (_,))`
+help: change the parameter type to match the trait
+   |
+LL |   extern "rust-call" fn call_mut(&mut self, (_,): (&'a T,)) {}
+   |                                                   ~~~~~~~~
 
 error[E0053]: method `call_once` has an incompatible type for trait
   --> $DIR/issue-20225.rs:18:47
@@ -33,13 +35,14 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo {
    |          - found this type parameter
 ...
 LL |   extern "rust-call" fn call_once(self, (_,): (T,)) {}
-   |                                               ^^^^
-   |                                               |
-   |                                               expected `&'a T`, found type parameter `T`
-   |                                               help: change the parameter type to match the trait: `(&'a T,)`
+   |                                               ^^^^ expected `&'a T`, found type parameter `T`
    |
    = note: expected signature `extern "rust-call" fn(Foo, (&'a _,))`
               found signature `extern "rust-call" fn(Foo, (_,))`
+help: change the parameter type to match the trait
+   |
+LL |   extern "rust-call" fn call_once(self, (_,): (&'a T,)) {}
+   |                                               ~~~~~~~~
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/issues/issue-21332.stderr b/tests/ui/issues/issue-21332.stderr
index 96e0f5fdb31..7c960f7646d 100644
--- a/tests/ui/issues/issue-21332.stderr
+++ b/tests/ui/issues/issue-21332.stderr
@@ -2,13 +2,14 @@ error[E0053]: method `next` has an incompatible type for trait
   --> $DIR/issue-21332.rs:5:27
    |
 LL |     fn next(&mut self) -> Result<i32, i32> { Ok(7) }
-   |                           ^^^^^^^^^^^^^^^^
-   |                           |
-   |                           expected `Option<i32>`, found `Result<i32, i32>`
-   |                           help: change the output type to match the trait: `Option<i32>`
+   |                           ^^^^^^^^^^^^^^^^ expected `Option<i32>`, found `Result<i32, i32>`
    |
    = note: expected signature `fn(&mut S) -> Option<i32>`
               found signature `fn(&mut S) -> Result<i32, i32>`
+help: change the output type to match the trait
+   |
+LL |     fn next(&mut self) -> Option<i32> { Ok(7) }
+   |                           ~~~~~~~~~~~
 
 error: aborting due to 1 previous error