diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-24 20:27:11 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-08-24 22:20:31 -0700 |
| commit | 7453f56e678c80928ababa2868c69cfe41647fed (patch) | |
| tree | 689bfb73cab6314cb91898b174fcf12d50196009 /lib/std/elf.zig | |
| parent | af19909b9cde3d009f0306ac825f39912644bca6 (diff) | |
| download | zig-7453f56e678c80928ababa2868c69cfe41647fed.tar.gz zig-7453f56e678c80928ababa2868c69cfe41647fed.zip | |
stage2: explicitly tagged enums no longer have one possible value
Previously, Zig had inconsistent semantics for an enum like this:
`enum(u8){zero = 0}`
Although in theory this can only hold one possible value, the tag
`zero`, Zig no longer will treat the type this way. It will do loads and
stores, as if the type has runtime bits.
Closes #12619
Tests passed locally:
* test-behavior
* test-cases
Diffstat (limited to 'lib/std/elf.zig')
| -rw-r--r-- | lib/std/elf.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/std/elf.zig b/lib/std/elf.zig index 16581b7782..cc43e11a7d 100644 --- a/lib/std/elf.zig +++ b/lib/std/elf.zig @@ -3,7 +3,7 @@ const io = std.io; const os = std.os; const math = std.math; const mem = std.mem; -const debug = std.debug; +const assert = std.debug.assert; const File = std.fs.File; const native_endian = @import("builtin").target.cpu.arch.endian(); @@ -872,14 +872,14 @@ pub const Elf_MIPS_ABIFlags_v0 = extern struct { }; comptime { - debug.assert(@sizeOf(Elf32_Ehdr) == 52); - debug.assert(@sizeOf(Elf64_Ehdr) == 64); + assert(@sizeOf(Elf32_Ehdr) == 52); + assert(@sizeOf(Elf64_Ehdr) == 64); - debug.assert(@sizeOf(Elf32_Phdr) == 32); - debug.assert(@sizeOf(Elf64_Phdr) == 56); + assert(@sizeOf(Elf32_Phdr) == 32); + assert(@sizeOf(Elf64_Phdr) == 56); - debug.assert(@sizeOf(Elf32_Shdr) == 40); - debug.assert(@sizeOf(Elf64_Shdr) == 64); + assert(@sizeOf(Elf32_Shdr) == 40); + assert(@sizeOf(Elf64_Shdr) == 64); } pub const Auxv = switch (@sizeOf(usize)) { |
