Properly handle async
blocks and fn
s in if
exprs without else
When encountering a tail expression in the then arm of an `if` expression without an `else` arm, account for `async fn` and `async` blocks to suggest `return`ing the value and pointing at the return type of the `async fn`. We now also account for AFIT when looking for the return type to point at. Fix #115405.
This commit is contained in:
parent
bdc15928c8
commit
37d2ea2fa0
12 changed files with 250 additions and 61 deletions
|
@ -900,7 +900,7 @@ impl<'a> Parser<'a> {
|
|||
// fn foo() -> Foo {
|
||||
// field: value,
|
||||
// }
|
||||
info!(?maybe_struct_name, ?self.token);
|
||||
debug!(?maybe_struct_name, ?self.token);
|
||||
let mut snapshot = self.create_snapshot_for_diagnostic();
|
||||
let path = Path {
|
||||
segments: ThinVec::new(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue