Skip to content

audit:resolution: a checked narrowing is the operand's type (part of #3423) - #3424

Merged
ehartford merged 1 commit into
mainfrom
audit-all-clean
Nov 18, 2026
Merged

ehartford merged 1 commit into
mainfrom
audit-all-clean

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

A shift count narrows to u32 with a range check that Sema records on the count's expression (D183). The lowering applied the narrowing and then recorded the narrowed operand against the expression's own type, so audit:resolution reported "an expression lowered to an operand of another type (MIR u32, Sema i32)" for every such shift: 36 false violations on the compiler's own source. The record now takes the narrowing Sema recorded, as it already does for the Option, splat and lane-conversion adjustments.

Test: behav_audit_checked_narrowing_operand runs a shift program and audit:resolution on it (fails before, passes after).

Part of #3423: audit:all on src/main.w goes from 76 violations to 40.

Battery green on the branch tip; :release-checks green.

…type. A shift count narrows to u32 with a range check (D183); the lowering applied it and then recorded the narrowed operand against the expression's own type, so every such shift read as 'an expression lowered to an operand of another type': 36 false violations on the compiler's own source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant