Repository navigation
fix(#9997): withhold plain-helper credit for boxed and aliased named closures - #11962
Conversation
…closures Extend bound_to_call_making_closure to recognize smart-pointer new of a call-making closure literal and bare-name alias chains up to four hops. Flip pinned residuals and add discriminating negatives. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 34 minutes. View limit details
|
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
merge-ready (pending CI re-run on PR head)
Local proof: CI note: First Green on draft qualification (pre–merge-ready): ub-review, workflow policy and wheel applicability, GitGuardian, dependency-review, cargo-deny, Ripr Rust Small Rust gates (first run). |
Summary
Extend
bound_to_call_making_closureso plain helpers withhold assertion credit when the test passes a name bound to a smart-pointer-wrapped call-making closure literal or an alias chain (depth cap four) of a named call-making closure.Governing issue or accepted claim: #9997
Advances #9997
Acceptance delta (one sentence): A plain helper that never invokes its closure parameter no longer lends its assertions when the test passes a name bound to a boxed call-making closure or an alias (up to four hops) of a named call-making closure.
Before / After
Before:
let c = Box::new(|| gate()); run_test(..., c)andlet h = c; run_test(..., h)still credited the helper'sassert_eq!(fail-open over-credit residuals).After: Those shapes withhold helper assertions the same way as
let c = || gate(); run_test(..., c).Tests added / updated
closure_callbacks/tests.rs: flipped boxed/alias residual rows; addedArc::new,std::boxed::Box::new, borrowed alias, two-hop alias, and negative controls.facts/test_helpers/tests.rs: alias test now expects withhold; new boxed-named facts-level case.Proof
cargo test -p ripr --lib a_name_bound_earliercargo test -p ripr --lib plain_helper_withheld_for_an_aliascargo test -p ripr --lib plain_helper_withheld_for_a_boxedcargo test -p ripr --lib function_item_passed_by_namecargo xtask precommitNot covered (#9997 remainders)
c.clone()