Skip to content

Commit

Permalink
Rollup merge of #130510 - samueltardieu:doc-letstmt-assign-desugar, r…
Browse files Browse the repository at this point in the history
…=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);
```
  • Loading branch information
matthiaskrgr authored Sep 18, 2024
2 parents 48b90aa + a47e9b6 commit c0951bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit c0951bb

Please sign in to comment.