about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2022-12-08 09:02:54 -0800
committerEsteban Küber <esteban@kuber.com.ar>2022-12-13 10:06:13 -0800
commite46416eed689655b9d395cb2fb7089bb7ec8aa9c (patch)
treea526f700bb4c4fc81d25d58bf39d8bfc3224f267 /src/test/ui/error-codes
parented620cf9690fdafed65845bf35c455db992fbba1 (diff)
downloadrust-e46416eed689655b9d395cb2fb7089bb7ec8aa9c.tar.gz
rust-e46416eed689655b9d395cb2fb7089bb7ec8aa9c.zip
Change pattern borrowing suggestions to be verbose
Synthesize a more accurate span and use verbose suggestion output to
make the message clearer.
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0508-fail.stderr6
-rw-r--r--src/test/ui/error-codes/E0508.stderr6
-rw-r--r--src/test/ui/error-codes/E0509.stderr6
3 files changed, 15 insertions, 3 deletions
diff --git a/src/test/ui/error-codes/E0508-fail.stderr b/src/test/ui/error-codes/E0508-fail.stderr
index b69d7743b6c..208ba30729f 100644
--- a/src/test/ui/error-codes/E0508-fail.stderr
+++ b/src/test/ui/error-codes/E0508-fail.stderr
@@ -6,7 +6,11 @@ LL |     let _value = array[0];
    |                  |
    |                  cannot move out of here
    |                  move occurs because `array[_]` has type `NonCopy`, which does not implement the `Copy` trait
-   |                  help: consider borrowing here: `&array[0]`
+   |
+help: consider borrowing here
+   |
+LL |     let _value = &array[0];
+   |                  +
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0508.stderr b/src/test/ui/error-codes/E0508.stderr
index 5e7b56dcd37..df2d3b0d311 100644
--- a/src/test/ui/error-codes/E0508.stderr
+++ b/src/test/ui/error-codes/E0508.stderr
@@ -6,7 +6,11 @@ LL |     let _value = array[0];
    |                  |
    |                  cannot move out of here
    |                  move occurs because `array[_]` has type `NonCopy`, which does not implement the `Copy` trait
-   |                  help: consider borrowing here: `&array[0]`
+   |
+help: consider borrowing here
+   |
+LL |     let _value = &array[0];
+   |                  +
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0509.stderr b/src/test/ui/error-codes/E0509.stderr
index cbfbc3ccf6a..c00d9142e75 100644
--- a/src/test/ui/error-codes/E0509.stderr
+++ b/src/test/ui/error-codes/E0509.stderr
@@ -6,7 +6,11 @@ LL |     let fancy_field = drop_struct.fancy;
    |                       |
    |                       cannot move out of here
    |                       move occurs because `drop_struct.fancy` has type `FancyNum`, which does not implement the `Copy` trait
-   |                       help: consider borrowing here: `&drop_struct.fancy`
+   |
+help: consider borrowing here
+   |
+LL |     let fancy_field = &drop_struct.fancy;
+   |                       +
 
 error: aborting due to previous error