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:176

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
1881(prove_ty_is_wf(env, assumptions, state, ty) => state)
191(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))
201(let state = state.with_local_in_scope(&env.env, label, id, ty)?)
202N/A(let state = if init.is_none() { state.with_uninit(&PlaceExpr::Var(id.clone())) } else { state.with_initialized(&PlaceExpr::Var(id.clone())) })
──────── ("let")
20455(borrow_check_statement(env, assumptions, state, Stmt::Let { label, id, ty, init }, places_live_on_exit) => (env, state))
if
LineCoverageSource
209(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)
2191(borrow_check_block(env, assumptions, state, then_block, places_live_on_exit) => then_state)
2201(borrow_check_block(env, assumptions, state, else_block, places_live_on_exit) => else_state)
223N/A(let state: FlowState = Union((then_state, else_state)).upcast())
──────── ("if")
22514(borrow_check_statement(env, assumptions, state, Stmt::If { condition, then_block, else_block }, places_live_on_exit) => (env, state))
expr
LineCoverageSource
22912(borrow_check_expr(
env,
assumptions,
state,
expr,
places_live_on_exit
) => (_init_ty, state))
──────── ("expr")
23715(borrow_check_statement(env, assumptions, state, Stmt::Expr { expr }, places_live_on_exit) => (env, state))
loop
LineCoverageSource
244N/A(let continue_live = Stmt::loop_(label, body).live_before(&env, &state, places_live_on_exit))
245(let state = state.push_continue_scope(&env.env, label, places_live_on_exit, continue_live)?)
2466(borrow_check_loop(env, assumptions, state, body, places_live_on_exit) => state)
247N/A(let state = state.pop_scope(label))
──────── ("loop")
24913(borrow_check_statement(env, assumptions, state, Stmt::Loop { label, body }, places_live_on_exit) => (env, state))
break
LineCoverageSource
255(if state.scope_has_label(label))
256N/A(let locals_to_drop = state.locals_dropped_to_label(label))
2572(drop_places(env, assumptions, state, locals_to_drop, places_live_on_exit) => state)
258N/A(let state = state.with_break(label))
259N/A(let state = state.diverges())
──────── ("break")
26111(borrow_check_statement(env, assumptions, state, Stmt::Break { label }, places_live_on_exit) => (env, state))
continue
LineCoverageSource
267(if state.scope_has_label(label))
2681(if let Some(places_live_on_continue) = state.live_after_continue(label))
269N/A(let locals_to_drop = state.locals_dropped_to_label(label))
2701(drop_places(env, assumptions, state, locals_to_drop, places_live_on_continue) => state)
271N/A(let state = state.with_continue(label))
272N/A(let state = state.diverges())
──────── ("continue")
2743(borrow_check_statement(env, assumptions, state, Stmt::Continue { label }, places_live_on_exit) => (env, state))
return
LineCoverageSource
2793(borrow_check_expr(env, assumptions, state, expr, LivePlaces::default()) => (expr_ty, state))
280(if let Some(output_ty) = &env.output_ty)
2814(prove_assignable(env, assumptions, state, expr_ty, output_ty) => state)
282N/A(let state = state.diverges())
──────── ("return")
28449(borrow_check_statement(env, assumptions, state, Stmt::Return { expr }, _places_live_on_exit) => (env, state))
block
LineCoverageSource
2894(borrow_check_block(env, assumptions, state, block, places_live_on_exit) => state)
──────── ("block")
2916(borrow_check_statement(env, assumptions, state, Stmt::Block(block), places_live_on_exit) => (env, state))
exists
LineCoverageSource
296N/A(let (env, subst, block) = env.instantiate_existentially(binder))
297N/A(let assumptions_body = (assumptions, wf_assumptions_for_existential_subst(&subst)))
29819(borrow_check_block(env, assumptions_body, state, block, places_live_on_exit) => state)
299N/A(let state = state.pop_subst(&env.env, subst))
──────── ("exists")
30123(borrow_check_statement(env, assumptions, state, Stmt::Exists { binder }, places_live_on_exit) => (env, state))
print
LineCoverageSource
306(borrow_check_expr(
env,
assumptions,
state,
expr,
places_live_on_exit
) => (_expr_ty, state))
──────── ("print")
31424(borrow_check_statement(env, assumptions, state, Stmt::Print { expr }, places_live_on_exit) => (env, state))