Skip to content

fix(rust): derive Copy when every field is Copy (+8) - #3354

Merged
gHashTag merged 3 commits into
masterfrom
struct-params-are-copy
Sep 6, 2026
Merged

fix(rust): derive Copy when every field is Copy (+8)#3354
gHashTag merged 3 commits into
masterfrom
struct-params-are-copy

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closes #3353

Generated structs derive Debug, Clone and not Copy, so a struct parameter passed by value is moved on first use. Six corpus specs fail on what reads as ordinary arithmetic:

return (region_width(r) * region_height(r));
return (est_dynamic_power_mw(u, t) + est_static_power_mw(u, t));
return (total_improvements(p) / p.num_modules);

Clone does not help — rustc will not insert a clone. Copy does, and it is what the spec's value semantics mean.

The guard is the design. Copy on a struct holding a Vec or a String does not compile, so it is emitted only when every field maps to a Copy type: the numeric primitives, bool, char, &'static str, and [T; N] where T qualifies. No transitivity — a field whose type is another struct answers false even when that struct did qualify, because a wrong Copy fails to compile while a missing one only leaves the status quo. Verified both ways: a primitive-only struct gets Copy, a struct with a Vec field does not.

Measured: 338 → 346, zero regressions.

+ boards/xc7a100t_minimal.t27      + fpga/power_analysis.t27
+ fpga/crossopt.t27                + igla/race/ternary_dot_sw.t27
+ fpga/memory.t27                  + igla/race/ternary_mac.t27
+ fpga/partition.t27
+ fpga/placement.t27

456 structs across the corpus gain Copy; 231 specs changed generated output and were re-sealed after the acceptance columns were read, which is the order tri seals drift demands.

Found in the cohort of 95 specs that fail on exactly one real error: use of moved value was 6 of them, and all six had the same shape.

@gHashTag
gHashTag enabled auto-merge (squash) September 6, 2026 04:37
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-06 04:37:53 UTC

Summary

Status Count
Total Open PRs 16
PRs with Failing Checks 10
PRs with All Checks Green 6
READY 5
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=23f03e8a97d5 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-06 04:47:30 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 11
PRs with All Checks Green 4
READY 0
FAILING 11
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=23f03e8a97d5 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-06 04:49:45 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 11
PRs with All Checks Green 4
READY 0
FAILING 11
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 11 + 0 + 0 = 11, and there are 15 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=23f03e8a97d5 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit dea182d into master Sep 6, 2026
36 checks passed
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.

A struct parameter used twice in one expression is moved twice

1 participant