You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deref_box and the is_box() place branch appear unreachable #4858
Proposed change: add a test that reaches GotocCtx::deref_box (kani-compiler/src/codegen_cprover_gotoc/utils/utils.rs) and the is_box() branch of place codegen that calls it (codegen/place.rs), or remove both. They look unreachable on the current toolchain. rustc's ElaborateBoxDerefs pass rewrites *b on a Box into field projections through Unique and NonNull before Kani sees the body.
Motivation:@feliperodri tested this in review of #4801. He put a panic! at the top of deref_box, and the whole kani suite still passed, 611 of 611:
// kani-compiler/src/codegen_cprover_gotoc/utils/utils.rs, first line of deref_boxpanic!("deref_box reached");
let x = *b; and (*boxed_dyn)(&2) both codegen without reaching it.
#4801 kept deref_box in step with box_value, because the two drifting apart caused #4800. But no test can show that half of the change working or breaking. If no MIR reaches the branch after elaboration, removing it leaves two readers of the chain: box_value and codegen_ptr_out_of_wrappers. I can take either option.
Activity
Walk the pattern type inside NonNull when codegenning a Box (model-ch…
Remove the unreachable `deref_box` (model-checking#4861)