diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-08-14 21:40:11 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-08-14 21:40:11 +0000 |
| commit | 6b58fbfd7ecb7a7ea90065aae0f307f903c0ce54 (patch) | |
| tree | 629647a1ea4eda1c8cb54afae7705d2220c9bd17 /tests/ui/self | |
| parent | 2c3fd1a23ac04b9a4d44501390d2a207b53d160a (diff) | |
| download | rust-6b58fbfd7ecb7a7ea90065aae0f307f903c0ce54.tar.gz rust-6b58fbfd7ecb7a7ea90065aae0f307f903c0ce54.zip | |
rebase and review comments
Diffstat (limited to 'tests/ui/self')
| -rw-r--r-- | tests/ui/self/arbitrary_self_types_needing_mut_pin.fixed | 3 | ||||
| -rw-r--r-- | tests/ui/self/arbitrary_self_types_needing_mut_pin.stderr | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/ui/self/arbitrary_self_types_needing_mut_pin.fixed b/tests/ui/self/arbitrary_self_types_needing_mut_pin.fixed index ccd65ff4091..a400a1672a4 100644 --- a/tests/ui/self/arbitrary_self_types_needing_mut_pin.fixed +++ b/tests/ui/self/arbitrary_self_types_needing_mut_pin.fixed @@ -8,5 +8,6 @@ impl S { } fn main() { - Pin::new(&mut S).x(); //~ ERROR no method named `x` found + let mut pinned = std::pin::pin!(S); + pinned.as_mut().x(); //~ ERROR no method named `x` found } diff --git a/tests/ui/self/arbitrary_self_types_needing_mut_pin.stderr b/tests/ui/self/arbitrary_self_types_needing_mut_pin.stderr index f34ce4dce49..5dcb5861120 100644 --- a/tests/ui/self/arbitrary_self_types_needing_mut_pin.stderr +++ b/tests/ui/self/arbitrary_self_types_needing_mut_pin.stderr @@ -4,16 +4,14 @@ error[E0599]: no method named `x` found for struct `S` in the current scope LL | struct S; | -------- method `x` not found for this struct ... -LL | fn x(self: Pin<&mut Self>) { - | - the method is available for `Pin<&mut S>` here -... LL | S.x(); | ^ method not found in `S` | -help: consider wrapping the receiver expression with the appropriate type +help: consider pinning the expression + | +LL ~ let mut pinned = std::pin::pin!(S); +LL ~ pinned.as_mut().x(); | -LL | Pin::new(&mut S).x(); - | +++++++++++++ + error: aborting due to previous error |
