Skip to content

t27o: read-only vec![..] literals become array literals (step 1 of #10546) #10643

Closed as not planned

Description

@gHashTag

Goal

Step 1 of #10546 (lane V of epic #10522): a vec![a, b, c] or vec![x; N] (N a constant) that a fn only reads -- a local never pushed to, resized, mutated, moved on or returned -- converts to a typed t27 array, const v : [3]T = [a, b, c]; / const v : [N]T = [x] ** N;, which t27 passes as a slice. Anything the fn changes, hands on or returns, or whose element type t27o cannot tell, stays refused, with a reason that says which.

Boundary

Done when

  • Tests per form (a local read by index, a local iterated with for, a local passed as &v, vec![0u8; 4]) and negative controls (a pushed vec, a returned or moved vec, an unknown element type stay refused) pass under t27b test, 0 vacuous under test-report.
  • The macro vec first-refusal count is reported before and after on the same five repositories and commits, and no converted output changes except where vec! was involved.

User Scenarios

  • Given a function contains a local let v = vec![a, b, c]; that is only read by index or iterated with for or passed as &v, and the element type is known, When t27o processes the function, Then the vec literal becomes a typed array const v : [3]T = [a, b, c]; passed as a slice.
  • Given a function contains let v = vec![x; N]; with constant N that is only read, When t27o processes the function, Then the vec literal becomes const v : [N]T = [x] ** N;.
  • Given a function contains a vec literal that is pushed to, returned, moved, resized, or has unknown element type, When t27o processes the function, Then the vec literal stays refused with a reason stating which condition prevented conversion.

Requirements

FR-001: t27o MUST convert a read-only vec![a, b, c] local with known element type to const v : [3]T = [a, b, c]; passed as a slice.
FR-002: t27o MUST convert a read-only vec![x; N] local with constant N and known element type to const v : [N]T = [x] ** N;.
FR-003: t27o MUST refuse conversion when the vec local is pushed to, and the reason MUST state "pushed".
FR-004: t27o MUST refuse conversion when the vec local is returned or moved, and the reason MUST state "returned or moved".
FR-005: t27o MUST refuse conversion when the vec local is resized or mutated, and the reason MUST state "resized or mutated".
FR-006: t27o MUST refuse conversion when the element type cannot be determined, and the reason MUST state "unknown element type".
FR-007: The macro vec first-refusal count MUST be reported before and after on the same five repositories and commits, with no converted output changes except where vec! was involved.

Activity

  1. added 7 commits that reference this issue on Oct 18, 2026
    92eb315
    b99ee71
    b340384
    3c90731
    df5ff4d
    df725a5
    097927f
  2. added
    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
    on Oct 18, 2026
  3. github-actions commented on Oct 18, 2026

    @github-actions
    Contributor

    Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.

    • missing: ## User Scenarios -- at least one Given/When/Then scenario
    • missing: ## Requirements -- numbered obligations, FR-001: ... MUST ...
  4. added 5 commits that reference this issue on Oct 18, 2026
    4d04b99
    8a9d171
    7162d76
    bd7f2c8
    e189a60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphi-loopPHI LOOP development cyclequeen-shapedshape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens ittooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions