about summary refs log tree commit diff
path: root/src/test/ui/compare-method
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-12-28 06:35:34 +0000
committerMichael Goulet <michael@errs.io>2022-12-28 18:09:27 +0000
commit01d784131f0a11d19d0ab5398b00ca6bbfd283b1 (patch)
tree6ad2a50282b179732cce8eaf4505b426cabe38c6 /src/test/ui/compare-method
parent83a28ef095ba4179a63196f16eadd97f110d6cb3 (diff)
downloadrust-01d784131f0a11d19d0ab5398b00ca6bbfd283b1.tar.gz
rust-01d784131f0a11d19d0ab5398b00ca6bbfd283b1.zip
Make trait/impl where clause mismatch on region error a bit more actionable
Diffstat (limited to 'src/test/ui/compare-method')
-rw-r--r--src/test/ui/compare-method/region-extra-2.stderr5
-rw-r--r--src/test/ui/compare-method/region-extra.stderr6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/compare-method/region-extra-2.stderr b/src/test/ui/compare-method/region-extra-2.stderr
index f01d7f4710c..eb19d57ab05 100644
--- a/src/test/ui/compare-method/region-extra-2.stderr
+++ b/src/test/ui/compare-method/region-extra-2.stderr
@@ -6,6 +6,11 @@ LL |     fn renew<'b: 'a>(self) -> &'b mut [T];
 ...
 LL |     fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
    |                                                     ^^ impl has extra requirement `'a: 'b`
+   |
+help: copy the `where` clause predicates from the trait
+   |
+LL |     fn renew<'b: 'a>(self) -> &'b mut [T] where 'b: 'a {
+   |                                           ~~~~~~~~~~~~
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/compare-method/region-extra.stderr b/src/test/ui/compare-method/region-extra.stderr
index 4a3af65e904..1a471e18d9d 100644
--- a/src/test/ui/compare-method/region-extra.stderr
+++ b/src/test/ui/compare-method/region-extra.stderr
@@ -6,6 +6,12 @@ LL |     fn foo();
 ...
 LL |     fn foo() where 'a: 'b { }
    |                        ^^ impl has extra requirement `'a: 'b`
+   |
+help: remove the `where` clause
+   |
+LL -     fn foo() where 'a: 'b { }
+LL +     fn foo()  { }
+   |
 
 error: aborting due to previous error