Repository navigation
An enum of values is a value (#2549); x86_64 Windows long double is windows-gnu's (#2771) - #2808
Merged
Merged
Conversation
added 3 commits
October 29, 2026 02:55
An enum of values was Copy only with `impl Copy` written ("an enum
instance stays opt-in"), so under D144 a match on a bare local observed it
and passing a payload on was refused: behav_generic_enum_nested_generic_
payload spelled `match move g` three times for G[i64] and H[i64], integers
in a tag. D111 decides copy-or-move by identity, and identity is
compositional (D120 stage 3 for structs): an enum is a value when every
payload is, unless it has a Drop impl or is a `resource type`.
fields_all_copy, which caches and cuts cycles for structs, walks an enum's
variant payloads too; is_copy asks it for a plain enum and a generic enum
instance. Codegen already carries the enum copy glue (each active payload
retained by tag): enums holding a str and a List copy and run clean under
the debug allocator.
Tests: behav_2549_enum_of_values_is_a_value (installed: use of moved
value; stage1: passes, audit:all clean); the fixture drops its three
`move`s.
…urce (#2549) The derive-Clone diagnostics tests took `enum Status { Idle, Busy }` as a type that is not Clone; under #2549 it is a value, so Copy and cloneable, and the derive succeeded. Status keeps its variants and gains a Drop impl, which gives it identity: neither Copy nor Clone, as the tests need. The bundle interface of an enum of i32s now carries `impl Copy for Color`, as the structs of values in the same interface already did.
…#2771) TargetSpec.c_long_double_is_double said a double for every Windows target, while the same file names x86_64 Windows's triple x86_64-w64-windows-gnu (#1915: the GNU environment, mingw-w64 UCRT; the build links libc/windows/ <arch>-w64-mingw32), whose clang reports a 16-byte, 80-bit x87 long double. c_import read the table and would import a MinGW function taking long double as taking f64, while the migrator, parsing under the triple, refused it (D51's hazard). One fact, two answers in one file. The table follows the triple: a double on AArch64 macOS and AArch64 Windows, wider elsewhere. The strtoll-family migrate fixture asks for strtold by the same rule (it had os() == "Macos", wrong on x86_64 macOS too), and the unit test asserts x86_64 Windows is not a double.
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 #2549 (D111: identity is compositional; fields_all_copy walks enum payloads; codegen's enum copy glue already retains payloads). Fixes #2771 (TargetSpec follows the windows-gnu triple, #1915).
Battery GREEN on 5c564bc (verdict.w: rc=0 green).