about summary refs log tree commit diff
path: root/tests/ui/pattern
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2024-11-25 20:25:10 -0800
committerdianne <diannes.gm@gmail.com>2024-11-25 20:29:04 -0800
commit04d9bb7a9a697f71abc4aac849a262f713807f29 (patch)
treedacd1c525cc03755f4013506e1f8bc1d90d79bca /tests/ui/pattern
parent6d22ff1215f0438574fd1487a0df7a27c76ffc70 (diff)
downloadrust-04d9bb7a9a697f71abc4aac849a262f713807f29.tar.gz
rust-04d9bb7a9a697f71abc4aac849a262f713807f29.zip
`add_move_error_suggestions`: use a HIR visitor rather than `SourceMap`
Diffstat (limited to 'tests/ui/pattern')
-rw-r--r--tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr b/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr
index 108db6d9e4b..2cf435b1179 100644
--- a/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr
+++ b/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr
@@ -9,6 +9,11 @@ LL |         deref!(x) => x,
    |                |
    |                data moved here
    |                move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
+   |
+help: consider borrowing the pattern binding
+   |
+LL |         deref!(ref x) => x,
+   |                +++
 
 error[E0507]: cannot move out of a shared reference
   --> $DIR/cant_move_out_of_pattern.rs:17:11
@@ -21,6 +26,11 @@ LL |         deref!(x) => x,
    |                |
    |                data moved here
    |                move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
+   |
+help: consider borrowing the pattern binding
+   |
+LL |         deref!(ref x) => x,
+   |                +++
 
 error: aborting due to 2 previous errors