Skip to content

[bug] t27o: the int_type_names splice refusal tests the mod alias, not the #[path] module, so mod names; slips through #10843

Closed

Description

@gHashTag

What is wrong

path (specs/tools/t27o/rust_convert.t27) refuses a call into the generated module int_type_names (R_SPLICE: the module's own use type_text:: stays unresolved when t27c splices it, so the spec test-report is BLOCKED -- the gap specs/compiler/int_type_names.t27 records). It decides that with

if (word_is(src, st[s], st[s + 1], "int_type_names")) { refuse(st, R_SPLICE, a, a, mb); return; }

but st[s] .. st[s + 1] of a K_MODPATH entry is the alias the mod item declares (ma .. mb), not the module: the module is the #[path] string, held in the owner slots (st[s + 2] .. st[s + 3], e.g. compiler/int_type_names). The check therefore passes whenever the alias is not literally int_type_names.

Repro (t27o of the branch of #10817)

#[path = "../../../gen/rust/compiler/int_type_names.rs"]
mod names;
fn suffix(t: &str) -> bool { names::is_integer_type_suffix(t.as_bytes()) }

tri t27o converts suffix and emits use compiler::int_type_names; plus int_type_names::is_integer_type_suffix(t) -- exactly the spec the refusal exists to prevent. With mod int_type_names; the same fn is refused with "a used module's own use t27c does not splice".

Expected

The refusal is decided by the module (the last segment of the #[path] string), so any alias is refused.

Found by

Writing the direct tests of path (lane C1 of #10522, issue #10825). The test that shows it is known_defect_the_splice_refusal_reads_the_alias_not_the_module_path in rust_convert.t27: it pins the current behaviour and flips when this is fixed.

User Scenarios

  • Given a Rust file with #[path = "../../../gen/rust/compiler/int_type_names.rs"] mod names; and a function calling names::is_integer_type_suffix, when tri t27o converts it, then the conversion must be refused with "a used module's own use t27c does not splice" instead of emitting use compiler::int_type_names; and the spliced call.

Requirements

  • FR-001: The splice refusal check in rust_convert.t27 MUST inspect the module path from the K_MODPATH owner slots (st[s+2]..st[s+3]) instead of the alias slots (st[s]..st[s+1]).
  • FR-002: The check MUST extract the last path segment of the #[path] string and refuse when that segment equals int_type_names, regardless of the mod alias.
  • FR-003: The existing pinned test known_defect_the_splice_refusal_reads_the_alias_not_the_module_path in rust_convert.t27 MUST be updated to assert the corrected behaviour.

Success Criteria

  • tri t27c specs/tools/t27o/rust_convert.t27 exits 0
  • tri t27c specs/compiler/int_type_names.t27 exits 0
  • The test known_defect_the_splice_refusal_reads_the_alias_not_the_module_path in specs/tools/t27o/rust_convert.t27 passes (1 test)
  • Converting the repro snippet with tri t27o now refuses with "a used module's own use t27c does not splice" (exit 0 with refusal message)

Boundary

  • specs/tools/t27o/rust_convert.t27
  • specs/compiler/int_type_names.t27

Activity

  1. added
    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
    on Oct 19, 2026
  2. github-actions commented on Oct 19, 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: ## Boundary -- list every file this task may touch, one per line (- specs/x.t27); without it the Queen reserves nothing and no bee can take the issue
    • missing: ## User Scenarios -- at least one Given/When/Then scenario
    • missing: ## Requirements -- numbered obligations, FR-001: ... MUST ...
    • missing: ## Success Criteria -- an outcome a machine can settle: a number with a unit, a backticked file, exit 0, or a backticked command
  3. removed
    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions