about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-06-11 21:27:46 +0100
committerGitHub <noreply@github.com>2024-06-11 21:27:46 +0100
commit260f789ae19c10a57d86437fda00989e9dbfecd9 (patch)
tree39166f2bf00f3771cd2c17f8b9cdb52dda1809dc /compiler/rustc_query_impl/src
parent91374faffb54af18d534754a0a69c99fe991c057 (diff)
parent5585f3133c05a33e59cd352a32fdf171447a9b2b (diff)
downloadrust-260f789ae19c10a57d86437fda00989e9dbfecd9.tar.gz
rust-260f789ae19c10a57d86437fda00989e9dbfecd9.zip
Rollup merge of #125684 - estebank:pin-to-binding-suggestion, r=pnkfelix
Account for existing bindings when suggesting `pin!()`

When we encounter a situation where we'd suggest `pin!()`, we now account for that expression existing as part of an assignment and provide an appropriate suggestion:

```
error[E0599]: no method named `poll` found for type parameter `F` in the current scope
  --> $DIR/pin-needed-to-poll-3.rs:19:28
   |
LL | impl<F> Future for FutureWrapper<F>
   |      - method `poll` not found for this type parameter
...
LL |         let res = self.fut.poll(cx);
   |                            ^^^^ method not found in `F`
   |
help: consider pinning the expression
   |
LL ~         let mut pinned = std::pin::pin!(self.fut);
LL ~         let res = pinned.as_mut().poll(cx);
   |
```

Fix #125661.
Diffstat (limited to 'compiler/rustc_query_impl/src')
0 files changed, 0 insertions, 0 deletions