diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 02:35:53 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 08:39:59 +0100 |
| commit | 0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 (patch) | |
| tree | 2c07fddf2b6230360fe618c4de192bc2d24eeaf7 /lib/std/Thread.zig | |
| parent | 1a178d499537b922ff05c5d0186ed5a00dbb1a9b (diff) | |
| download | zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.tar.gz zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.zip | |
std: update `std.builtin.Type` fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.
This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
Diffstat (limited to 'lib/std/Thread.zig')
| -rw-r--r-- | lib/std/Thread.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index 87a4eec921..60021346e4 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -401,15 +401,15 @@ fn callFn(comptime f: anytype, args: anytype) switch (Impl) { const default_value = if (Impl == PosixThreadImpl) null else 0; const bad_fn_ret = "expected return type of startFn to be 'u8', 'noreturn', '!noreturn', 'void', or '!void'"; - switch (@typeInfo(@typeInfo(@TypeOf(f)).Fn.return_type.?)) { - .NoReturn => { + switch (@typeInfo(@typeInfo(@TypeOf(f)).@"fn".return_type.?)) { + .noreturn => { @call(.auto, f, args); }, - .Void => { + .void => { @call(.auto, f, args); return default_value; }, - .Int => |info| { + .int => |info| { if (info.bits != 8) { @compileError(bad_fn_ret); } @@ -422,7 +422,7 @@ fn callFn(comptime f: anytype, args: anytype) switch (Impl) { // pthreads don't support exit status, ignore value return default_value; }, - .ErrorUnion => |info| { + .error_union => |info| { switch (info.payload) { void, noreturn => { @call(.auto, f, args) catch |err| { @@ -850,17 +850,17 @@ const WasiThreadImpl = struct { fn entry(ptr: usize) void { const w: *@This() = @ptrFromInt(ptr); const bad_fn_ret = "expected return type of startFn to be 'u8', 'noreturn', 'void', or '!void'"; - switch (@typeInfo(@typeInfo(@TypeOf(f)).Fn.return_type.?)) { - .NoReturn, .Void => { + switch (@typeInfo(@typeInfo(@TypeOf(f)).@"fn".return_type.?)) { + .noreturn, .void => { @call(.auto, f, w.args); }, - .Int => |info| { + .int => |info| { if (info.bits != 8) { @compileError(bad_fn_ret); } _ = @call(.auto, f, w.args); // WASI threads don't support exit status, ignore value }, - .ErrorUnion => |info| { + .error_union => |info| { if (info.payload != void) { @compileError(bad_fn_ret); } |
