Skip to content

fix(#9997): withhold plain-helper credit for boxed and aliased named closures - #11962

Merged
EffortlessSteven merged 1 commit into
mainfrom
cursor/boxed-aliased-named-closure-b3fd
Oct 31, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
cursor/boxed-aliased-named-closure-b3fd

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Extend bound_to_call_making_closure so 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) and let h = c; run_test(..., h) still credited the helper's assert_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; added Arc::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_earlier
  • cargo test -p ripr --lib plain_helper_withheld_for_an_alias
  • cargo test -p ripr --lib plain_helper_withheld_for_a_boxed
  • cargo test -p ripr --lib function_item_passed_by_name
  • cargo xtask precommit

Not covered (#9997 remainders)

  • Function items passed by name (needs file-level lookup)
  • Deferred assignment, conditional initializers, and wrapping expressions such as c.clone()
Open in Web Open in Cursor 

…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>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 150 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 44d551ae-2e6b-4a65-91ba-05cdb1048025
Commits

Reviewing files that changed from the base of the PR and between df99f28 and 55943a8.

Files selected for processing: 4
  • changelog.d/9997-boxed-and-aliased-named-closure.md
  • crates/ripr/src/analysis/facts/test_helpers/tests.rs
  • crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs
  • crates/ripr/src/analysis/syntax/ra/closure_callbacks/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 31, 2026 23:35
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven
EffortlessSteven merged commit 625bc0d into main Oct 31, 2026
53 checks passed
@EffortlessSteven
EffortlessSteven deleted the cursor/boxed-aliased-named-closure-b3fd branch October 31, 2026 23:43
@EffortlessSteven

Copy link
Copy Markdown
Member Author

merge-ready (pending CI re-run on PR head)

Local proof: cargo xtask precommit on branch tip; focused #9997 tests pass.

CI note: First merge-ready qualification failed on Rust tests shard 3 with compare_literal_values_fails_open_on_undecoded_literals (inherited from base before #11918 on main; unrelated to this diff). Branch tip merges current main.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants