Skip to main content

lower_provider_given_ir

Function lower_provider_given_ir 

Source
pub fn lower_provider_given_ir(provider: &ProviderDecl) -> Vec<CapRefIr>
Expand description

A provider’s own given clause, resolved independent of ProviderBody’s external/Bynk dispatch and independent of lower_provider_item_ir’s own full assembly (#1187’s Provider given/deps-wiring slice) — the standalone entry point bynk-emit/src/project.rs’s instantiate_provider_ts_expr actually calls. Building a real IrItem::Provider there would still need care for a Bynk provider specifically: ProviderBody::Bynk::ops unconditionally lowers every op’s body through lower_provider_op_irlower_expr_ir, which does not yet handle every expression shape a real op body can contain. Correction (P6.25, 2026-08-19): ? propagation (ExprKind::Question) and an is-expression (ExprKind::Is) are no longer among those gaps — both landed (P6.15/ADR 0337, P6.16/ADR 0338, following #1225’s own Ok/Err/Some/None construction fix) — but lower_expr_ir still has two production-reachable todo!()s (lower_call_ir’s missing-Callee guard and a bare ident naming a free fn used as a value, P6.2 territory), so a real op body is not yet unconditionally safe to build; the risk has just narrowed. This function never touches ops/bodies, so it carries none of that risk; lower_provider_item_ir itself now calls it too, rather than hand-duplicating the one-line map.