about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-13 06:27:37 +0100
committerGitHub <noreply@github.com>2024-02-13 06:27:37 +0100
commit020e84652dbcf660a4983aa460a29f0267b5f590 (patch)
treef15798ac022aff012b26f825b3ad81ae32cfa184 /compiler/rustc_parse/src/parser
parentd26b41711282042c4ea0c5733e7332b07cfa4933 (diff)
parentd07195fe6b5f522438d9d79f4bec3bdc44ce9764 (diff)
downloadrust-020e84652dbcf660a4983aa460a29f0267b5f590.tar.gz
rust-020e84652dbcf660a4983aa460a29f0267b5f590.zip
Rollup merge of #120696 - estebank:issue-115405, r=oli-obk
Properly handle `async` block and `async fn` 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/parser')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs2
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(),