From a47e9b6c54adb5a9577e6394a8ba4b98aac55f21 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 18 Sep 2024 14:49:20 +0200 Subject: [PATCH] doc: the source of `LetStmt` can also be `AssignDesugar` For example, the two following statements are desugared into a block whose `LetStmt` source is `AssignDesugar`: ```rust _ = ignoring_some_result(); (a, b) = (b, a); ``` --- compiler/rustc_hir/src/hir.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 26118bcbb9f..f92c6650355 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1378,7 +1378,8 @@ pub struct LetStmt<'hir> { pub hir_id: HirId, pub span: Span, /// Can be `ForLoopDesugar` if the `let` statement is part of a `for` loop - /// desugaring. Otherwise will be `Normal`. + /// desugaring, or `AssignDesugar` if it is the result of a complex + /// assignment desugaring. Otherwise will be `Normal`. pub source: LocalSource, }