about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-09-18 17:49:45 +0200
committerGitHub <noreply@github.com>2024-09-18 17:49:45 +0200
commitc0951bbce262aab3c0dfdd9f3ebbc0bdf7543173 (patch)
tree1a1b46d23d14efea8c202c0756adf2d88c4073f7
parent48b90aaed38a85afafa45a15198a1472b84acf98 (diff)
parenta47e9b6c54adb5a9577e6394a8ba4b98aac55f21 (diff)
downloadrust-c0951bbce262aab3c0dfdd9f3ebbc0bdf7543173.tar.gz
rust-c0951bbce262aab3c0dfdd9f3ebbc0bdf7543173.zip
Rollup merge of #130510 - samueltardieu:doc-letstmt-assign-desugar, r=compiler-errors
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);
```
-rw-r--r--compiler/rustc_hir/src/hir.rs3
1 files changed, 2 insertions, 1 deletions
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,
 }