diff options
| author | Michael Goulet <michael@errs.io> | 2023-03-02 23:49:24 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-04-12 23:20:11 +0000 |
| commit | 29aee6a125ac65a01932cb0ece5485e7cf8cfe87 (patch) | |
| tree | 5f834161b1dc5b47ad05b2b179ea6893f65b7992 /tests | |
| parent | e72c45ad987b296baee79865b7e2ca00c518fb8b (diff) | |
| download | rust-29aee6a125ac65a01932cb0ece5485e7cf8cfe87.tar.gz rust-29aee6a125ac65a01932cb0ece5485e7cf8cfe87.zip | |
Restore suggestion based off of backwards inference from bad usage to method call
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/type/type-check/point-at-inference.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/type/type-check/point-at-inference.stderr | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/ui/type/type-check/point-at-inference.fixed b/tests/ui/type/type-check/point-at-inference.fixed index 6419e42e70d..f41fbe59fba 100644 --- a/tests/ui/type/type-check/point-at-inference.fixed +++ b/tests/ui/type/type-check/point-at-inference.fixed @@ -6,7 +6,7 @@ fn main() { let mut foo = vec![]; baz(&foo); for i in &v { - foo.push(i); + foo.push(*i); } baz(&foo); bar(foo); //~ ERROR E0308 diff --git a/tests/ui/type/type-check/point-at-inference.stderr b/tests/ui/type/type-check/point-at-inference.stderr index 5d46368b1fd..5fc94d4d1b6 100644 --- a/tests/ui/type/type-check/point-at-inference.stderr +++ b/tests/ui/type/type-check/point-at-inference.stderr @@ -18,6 +18,10 @@ note: function defined here | LL | fn bar(_: Vec<i32>) {} | ^^^ ----------- +help: consider dereferencing the borrow + | +LL | foo.push(*i); + | + error: aborting due to previous error |
