const SwitchNonErr = union(enum) none: noneA regular switch expression. Emits switch_block[_ref].
@"catch": @"catch"eu catch |err| switch (err) { ... }
switch must not be labeled. Emits switch_block_err_union.
@"if": Ast.full.Ifif (eu) |payload| { ... } else |err| switch (err) { ... }
switch must not be labeled. Emits switch_block_err_union.
peer_break_target: struct { /// Refers to the enclosing block of the entire switch-on-err expression. block_inst: Zir.Inst.Index, /// Belongs to `block_inst`. block_ri: ResultInfo, }eu catch |err| label: switch (err) { ... } if (eu) |payload| { ... } else |err| label: switch (err) { ... }
switch must be labeled. Emits a condbr on the non-error body and a regular switch, though the non-error prong and all breaks from switch prongs are peers. Exists to avoid a rather complex special case of switch_block_err_union.
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021const SwitchNonErr = union(enum) {
/// A regular switch expression.
/// Emits `switch_block[_ref]`.
none,
/// `eu catch |err| switch (err) { ... }`
///
/// `switch` must not be labeled.
/// Emits `switch_block_err_union`.
@"catch",
/// `if (eu) |payload| { ... } else |err| switch (err) { ... }`
///
/// `switch` must not be labeled.
/// Emits `switch_block_err_union`.
@"if": Ast.full.If,
/// `eu catch |err| label: switch (err) { ... }`
/// `if (eu) |payload| { ... } else |err| label: switch (err) { ... }`
///
/// `switch` must be labeled.
/// Emits a `condbr` on the non-error body and a regular switch, though the
/// non-error prong and all `break`s from switch prongs are peers.
/// Exists to avoid a rather complex special case of `switch_block_err_union`.
peer_break_target: struct {
/// Refers to the enclosing block of the entire switch-on-err expression.
block_inst: Zir.Inst.Index,
/// Belongs to `block_inst`.
block_ri: ResultInfo,
},
}