Judgment prove_place_is_movable
judgment_fn! {
/// Prove that a place can be moved from.
///
/// A place is movable if it is not behind a reference. When a `Deref` is
/// encountered, the deref'd type must be an "owned deref" (e.g., `Box`).
/// Since we don't model owned deref types yet, all derefs through
/// references (`&T` / `&mut T`) will cause this judgment to fail.
fn prove_place_is_movable(
env: TypeckEnv,
assumptions: Predicates,
state: FlowState,
place: TypedPlaceExpr,
) => FlowState {
/* rules omitted */
}
}
Source: crates/formality-rust/src/check/borrow_check/nll.rs:1100
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.
local| Line | Coverage | Source |
|---|---|---|
| ──────── ("local") | ||
| 1117 | 126 | (prove_place_is_movable( _env, _assumptions, state, TypedPlaceExpressionData::Local(_), ) => state) |
field| Line | Coverage | Source |
|---|---|---|
| 1126 | 1 | (if let None = env.program.find_drop_impl(adt_id)) |
| 1127 | ✗ | (prove_place_is_movable(env, assumptions, state, prefix) => state) |
| ──────── ("field") | ||
| 1129 | 11 | (prove_place_is_movable( env, assumptions, state, TypedPlaceExpressionData::Field(prefix, _, adt_id, _), ) => state) |
copy| Line | Coverage | Source |
|---|---|---|
| 1138 | 3 | (prove_ty_is_copy(env, assumptions, state, &place.ty) => state) |
| ──────── ("copy") | ||
| 1140 | 28 | (prove_place_is_movable(env, assumptions, state, place) => state) |