Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

anyErrdefers

AstGen.anyErrdefers
fn anyErrdefers(outer_scope: *Scope, inner_scope: *Scope) bool

File

lib/std/zig/AstGen.zig:2974

Code

fn anyErrdefers(outer_scope: *Scope, inner_scope: *Scope) bool {
    var scope = inner_scope;
    while (scope != outer_scope) {
        switch (scope.unwrap()) {
            .gen_zir => |gen_zir| scope = gen_zir.parent,
            .local_val => |local_val| scope = local_val.parent,
            .local_ptr => |local_ptr| scope = local_ptr.parent,
            .defer_normal => |defer_normal| scope = defer_normal.parent,
            .defer_error => return true,
            .namespace => unreachable,
            .top => unreachable,
        }
    }
    return false;
}