fn restore_res_ctx(ctx: &mut Context, to: usize) {
    let calls_backup = std::mem::take(&mut ctx.calls);
    for call in &calls_backup[0..to] {
        foreach_call_arg(call, |val| {
            if let Some(val) = val.as_res() {
                let ty = val.ty(ctx.target()).checked_as_res();
                let kind = ty.res_name();
                if val.dir() != Dir::In && val.own_res() {
                    ctx.record_res(kind, val.res_val_id().unwrap());
                }
            }
        })
    }
    ctx.calls = calls_backup;
}
/// Restore generated resources to `ctx`.  
Restore generated resources to `ctx`.
Restore generated resources to ` ctx ` .
fn restore_res_ctx(ctx: &mut Context, to: usize) {
    let calls_backup = std::mem::take(&mut ctx.calls);
    for call in &calls_backup[0..to] {
        foreach_call_arg(call, |val| {
            if let Some(val) = val.as_res() {
                let ty = val.ty(ctx.target()).checked_as_res();
                let kind = ty.res_name();
                if val.dir() != Dir::In && val.own_res() {
                    ctx.record_res(kind, val.res_val_id().unwrap());
                }
            }
        })
    }
    ctx.calls = calls_backup;
}
fn restore_res_ctx ( ctx : & mut Context , to : usize ) { let calls_backup = std :: mem :: take ( & mut ctx . calls ) ; for call in & calls_backup [ 0 .. to ] { foreach_call_arg ( call , | val | { if let Some ( val ) = val . as_res ( ) { let ty = val . ty ( ctx . target ( ) ) . checked_as_res ( ) ; let kind = ty . res_name ( ) ; if val . dir ( ) != Dir :: In && val . own_res ( ) { ctx . record_res ( kind , val . res_val_id ( ) . unwrap ( ) ) ; } } } ) } ctx . calls = calls_backup ; }
Restore generated resources to `ctx`.
Restore generated resources to ` ctx ` .
ctx
&mut Context
to
usize
ctx
&mut Context
to
usize