Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Judgment borrow_check_statement at crates/formality-rust/src/check/borrow_check/nll.rs:177

Signature:

borrow_check_statement(env: TypeckEnv, assumptions: Wcs, state: FlowState, statement: Stmt, places_live_on_exit: LivePlaces,) => (TypeckEnv, FlowState)

No applicable rule observed: at least one test exercised this judgment with no matching rule.

The number on each rule’s conclusion is positive coverage; the number on each premise is negative coverage. Click a number to browse the tests.

let
LineCoverageSource
1891(prove_ty_is_wf(env, assumptions, state, ty) => state)
192(for_all(init in init.into_iter()) with (state) // FIXME: should make syntax for this
(let Init { expr } = init)
(borrow_check_expr_has_ty(env,
assumptions,
state,
expr,
ty,
LiveBefore::live_before(&Assignment(id), env, &state, &places_live_on_exit),
) => state))
202(let state = state.with_local_in_scope(&env.env, label, id, ty)?)
203N/A(let state = if init.is_none() { state.with_uninit(&PlaceExpr::Var(id.clone())) } else { state.with_initialized(&PlaceExpr::Var(id.clone())) })
──────── ("let")
20587(borrow_check_statement(env, assumptions, state, Stmt::Let { label, id, ty, init }, places_live_on_exit) => (env, state))
if
LineCoverageSource
210(borrow_check_expr_has_ty(
env,
assumptions,
state,
condition,
Ty::bool(),
Either(then_block, else_block).live_before(env, &state, places_live_on_exit),
) => state)
2202(borrow_check_block(env, assumptions, state, then_block, places_live_on_exit) => then_state)
2213(borrow_check_block(env, assumptions, state, else_block, places_live_on_exit) => else_state)
224N/A(let state: FlowState = Union((then_state, else_state)).upcast())
──────── ("if")
22645(borrow_check_statement(env, assumptions, state, Stmt::If { condition, then_block, else_block }, places_live_on_exit) => (env, state))
expr
LineCoverageSource
23018(borrow_check_expr(
env,
assumptions,
state,
expr,
places_live_on_exit
) => (_init_ty, state))
──────── ("expr")
23836(borrow_check_statement(env, assumptions, state, Stmt::Expr { expr }, places_live_on_exit) => (env, state))
loop
LineCoverageSource
245N/A(let continue_live = Stmt::loop_(label, body).live_before(&env, &state, places_live_on_exit))
246(let state = state.push_continue_scope(&env.env, label, places_live_on_exit, continue_live)?)
24710(borrow_check_loop(env, assumptions, state, body, places_live_on_exit) => state)
248N/A(let state = state.pop_scope(label))
──────── ("loop")
25034(borrow_check_statement(env, assumptions, state, Stmt::Loop { label, body }, places_live_on_exit) => (env, state))
break
LineCoverageSource
256(if state.scope_has_label(label))
257N/A(let locals_to_drop = state.locals_dropped_to_label(label))
2582(drop_places(env, assumptions, state, locals_to_drop, places_live_on_exit) => state)
259N/A(let state = state.with_break(label))
260N/A(let state = state.diverges())
──────── ("break")
26224(borrow_check_statement(env, assumptions, state, Stmt::Break { label }, places_live_on_exit) => (env, state))
continue
LineCoverageSource
268(if state.scope_has_label(label))
2691(if let Some(places_live_on_continue) = state.live_after_continue(label))
270N/A(let locals_to_drop = state.locals_dropped_to_label(label))
2711(drop_places(env, assumptions, state, locals_to_drop, places_live_on_continue) => state)
272N/A(let state = state.with_continue(label))
273N/A(let state = state.diverges())
──────── ("continue")
2753(borrow_check_statement(env, assumptions, state, Stmt::Continue { label }, places_live_on_exit) => (env, state))
return
LineCoverageSource
2804(borrow_check_expr(env, assumptions, state, expr, LivePlaces::default()) => (expr_ty, state))
281(if let Some(output_ty) = &env.output_ty)
2824(prove_assignable(env, assumptions, state, expr_ty, output_ty) => state)
283N/A(let state = state.diverges())
──────── ("return")
28581(borrow_check_statement(env, assumptions, state, Stmt::Return { expr }, _places_live_on_exit) => (env, state))
block
LineCoverageSource
2904(borrow_check_block(env, assumptions, state, block, places_live_on_exit) => state)
──────── ("block")
2926(borrow_check_statement(env, assumptions, state, Stmt::Block(block), places_live_on_exit) => (env, state))
exists
LineCoverageSource
296(if feature_gate_enabled_in_program(&env.program, &FeatureGateName::PoloniusUnlocked))
298N/A(let (env, subst, block) = env.instantiate_existentially(binder))
299N/A(let assumptions_body = (assumptions, wf_assumptions_for_existential_subst(&subst)))
3001(borrow_check_block(env, assumptions_body, state, block, places_live_on_exit) => state)
301N/A(let state = state.pop_subst(&env.env, subst))
──────── ("exists")
30354(borrow_check_statement(env, assumptions, state, Stmt::Exists { binder }, places_live_on_exit) => (env, state))
exists
LineCoverageSource
307(if feature_gate_enabled_in_program(&env.program, &FeatureGateName::PoloniusAlpha))
309N/A(let (env, subst, block) = env.instantiate_existentially(binder))
310N/A(let assumptions_body = (assumptions, wf_assumptions_for_existential_subst(&subst)))
3113(borrow_check_block(env, assumptions_body, state, block, places_live_on_exit) => state)
3151(verify_universal_outlives(env, assumptions_body, &state.all_outlives) => ())
316N/A(let state = state.pop_subst(&env.env, subst))
──────── ("exists")
31854(borrow_check_statement(env, assumptions, state, Stmt::Exists { binder }, places_live_on_exit) => (env, state))
exists
LineCoverageSource
322(if !feature_gate_enabled_in_program(&env.program, &FeatureGateName::PoloniusUnlocked) && !feature_gate_enabled_in_program(&env.program, &FeatureGateName::PoloniusAlpha))
324N/A(let (env, subst, block) = env.instantiate_existentially(binder))
325N/A(let assumptions_body = (assumptions, wf_assumptions_for_existential_subst(&subst)))
326N/A(let entry_state = state.clone())
32723(borrow_check_block(env, assumptions_body, state, block, places_live_on_exit) => state)
329N/A(let state = entry_state.with_global_outlives_from(&state))
3306(borrow_check_block(env, assumptions_body, state, block, places_live_on_exit) => state)
331N/A(let state = state.pop_subst(&env.env, subst))
──────── ("exists")
33354(borrow_check_statement(env, assumptions, state, Stmt::Exists { binder }, places_live_on_exit) => (env, state))
print
LineCoverageSource
338(borrow_check_expr(
env,
assumptions,
state,
expr,
places_live_on_exit
) => (_expr_ty, state))
──────── ("print")
34624(borrow_check_statement(env, assumptions, state, Stmt::Print { expr }, places_live_on_exit) => (env, state))