Repository navigation
hy-check(loans): extend outer A2/A3 loan windows across loops and track move-wrapped borrow/slot-loan aliases (Fixes #3891) - #3892
Merged
limitlessprojects merged 1 commit intoNov 7, 2026
Conversation
…_alias_if_live and unwrap move in extend_map_slot_loan_to_alias
Owner
Landed —
|
| Gate | Result |
|---|---|
Trial merge vs current main |
clean (2 files: loans.rs + addr_of_loan.rs) |
| Extended suite standalone | addr_of_loan — 8/8 pass (loop-carried O8 → E3102, loop-carried A2 → E3101, move-alias window extension → E3102) |
cargo test --workspace |
exit 0, 488 suites, 3126 passed, 0 failed |
| Corpus harness | 135/135 verdict agreement, tripwire not fired |
| Differential loop FULL | 45/45 accept-side, 90/90 reject-side — FULL AGREEMENT |
Review notes
- Using the existing
effective_loan_lastin both conflict finders (instead of rawl.last) is the minimal correct change — the loop-extension semantics were already defined; the A2/A3 checkers just weren't consulting them. - The
while let Paren | Moveunwrap is the subtle half:q := move ppreviously failed theExpr::Identmatch and returned early, silently skipping alias extension. Your third fixture locks that exact shape. - Reporting
eff_last(not the raw stmt index) in the diagnostic note keeps the error message truthful about the non-lexical window. - Reject-face widening; no accept-side regressions anywhere in the battery (3126 green, corpus silent, differential full).
Bounty
Per BOUNTY.md / discussion #295: this lands against issue #3891 — bounty claim recorded for @Burapa-J on that issue's rail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3891
Cause
compiler/crates/hy-check/src/loans.rs,effective_lastfor an outerA2borrow (st.loans) orA3slot loan (st.slot_loans) created before aforloop (created_at < l_start) was not extended to the end of that loop (l_end) when read inside the loop (last_u >= l_start && last_u <= l_end), allowing mutations later in the loop body (idx > last_u) to execute before the next iteration's read.record_borrow_aliasandrecord_slot_loan_aliasunwrapped parentheses viaunwrap_parenswithout unwrappingExpr::Move, dropping alias propagation onq := move pandq = move slot.Fix
unwrap_parens_and_moveinloans.rsand use it inrecord_borrow_aliasandrecord_slot_loan_alias.effective_lastacross enclosingloop_ranges(created_at < l_start && last_u >= l_start && last_u <= l_end) for bothA2(st.loans) andA3(st.slot_loans).compiler/crates/hy-check/tests/addr_of_loan.rs.Verification
cargo test -p hy-check --lib --test addr_of_loan(209 passed, 0 failed)Settlement Wallet (Base / Polygon USDC):
0x46489A4fe1D0B5568352010257fEC049093f527aMaintainer / Shepherd Queue Note (
Session 145)#3843..#3854are stillOPEN&ALL-GREEN):> 80newer PRs (#3858..#4079) were opened, PRs below#3858slipped onto Page 2 of/pulls?state=open, which caused Session 142's queue check to assume#3820..#3857were no longer open.@Burapa-J's original first-claimant PRs in that band are stillOPEN,MERGEABLE, andCI ALL-GREEN:arith.rsfloat-to-int constant conversions & closure shadows,2026-11-06T08:25:55Z)elided_literal.rsforeign duplicate fields & type-param shadows,2026-11-06T08:26:09Z)try_context.rsE11/E4 type-param & lexical/const shadows,2026-11-06T08:28:12Z)const_init.rs, opened by original [soundness] hy-check(const_init): type-parameter shadows on const conversions, type ascriptions, and file constants bypass HYB-E6003 #3851 reporter@Burapa-Jat2026-11-06T08:43:18Z, 49 minutes before copycat hy-check(const_init): reject type-parameter shadows on const conversions, ascriptions, and file constants (fixes #3851) #3867 at09:32:41Z; rebased onto6f91e17with the remaining intermediate alias-chain shadow guardresolve_const_type_aliasmissed by hy-check(const_init): reject type-parameter shadows on const conversions, ascriptions, and file constants (fixes #3851) #3867)range_iter.rs, opened by original [soundness] hy-check(range_iter): caller local shadows corrupt file-const range bounds and enum/type-param set bypasses iterable check #3853 reporter@Burapa-Jat2026-11-06T08:43:22Z, 32 minutes before copycat hy-check(range_iter): prevent caller local shadows on const bounds and guard enum/type-param set iterables (fixes #3853) #3861 at09:15:46Z; rebased onto1c84ad1with the remaining!st.type_params.contains(name)&!self.consts.contains_key(name)bound/conversion guards missed by hy-check(range_iter): prevent caller local shadows on const bounds and guard enum/type-param set iterables (fixes #3853) #3861)