Skip to content

Commit

Permalink
Rollup merge of rust-lang#122430 - GuillaumeGomez:link-to-local, r=Ta…
Browse files Browse the repository at this point in the history
…KO8Ki

Generate link to `Local` in `hir::Let` documentation

This PR adds a missing link generation to `Local` type.
  • Loading branch information
matthiaskrgr authored Mar 13, 2024
2 parents 50c35ce + d919b04 commit 229bb51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1253,11 +1253,11 @@ pub struct Arm<'hir> {
pub body: &'hir Expr<'hir>,
}

/// Represents a `let <pat>[: <ty>] = <expr>` expression (not a Local), occurring in an `if-let` or
/// `let-else`, evaluating to a boolean. Typically the pattern is refutable.
/// Represents a `let <pat>[: <ty>] = <expr>` expression (not a [`Local`]), occurring in an `if-let`
/// or `let-else`, evaluating to a boolean. Typically the pattern is refutable.
///
/// In an if-let, imagine it as `if (let <pat> = <expr>) { ... }`; in a let-else, it is part of the
/// desugaring to if-let. Only let-else supports the type annotation at present.
/// In an `if let`, imagine it as `if (let <pat> = <expr>) { ... }`; in a let-else, it is part of
/// the desugaring to if-let. Only let-else supports the type annotation at present.
#[derive(Debug, Clone, Copy, HashStable_Generic)]
pub struct Let<'hir> {
pub span: Span,
Expand Down

0 comments on commit 229bb51

Please sign in to comment.