diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-02-06 03:30:16 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-02-12 20:26:34 +0000 |
| commit | 37d2ea2fa064411de78ec24a178a05dc02517673 (patch) | |
| tree | e9f50135d04c2fc484cd435bf07704a751a8b468 /compiler/rustc_parse/src | |
| parent | bdc15928c8119a86d15e2946cb54851264607842 (diff) | |
| download | rust-37d2ea2fa064411de78ec24a178a05dc02517673.tar.gz rust-37d2ea2fa064411de78ec24a178a05dc02517673.zip | |
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.
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 7a24b819b5f..445d5b2ce79 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -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(), |
