We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ExprKind::If
Expr
1 parent c4e05e5 commit cf878d8Copy full SHA for cf878d8
compiler/rustc_hir/src/hir.rs
@@ -2744,6 +2744,8 @@ pub enum ExprKind<'hir> {
2744
///
2745
/// The "then" expr is always `ExprKind::Block`. If present, the "else" expr is always
2746
/// `ExprKind::Block` (for `else`) or `ExprKind::If` (for `else if`).
2747
+ /// Note that using an `Expr` instead of a `Block` for the "then" part is intentional,
2748
+ /// as it simplifies the type coercion machinery.
2749
If(&'hir Expr<'hir>, &'hir Expr<'hir>, Option<&'hir Expr<'hir>>),
2750
/// A conditionless loop (can be exited with `break`, `continue`, or `return`).
2751
0 commit comments