std.Thread: fix mutable ref of temporary
The previous code is a compile error in stage2 as well as the upcoming lang spec.
This commit is contained in:
@@ -513,7 +513,8 @@ const WindowsThreadImpl = struct {
|
||||
errdefer assert(windows.kernel32.HeapFree(heap_handle, 0, alloc_ptr) != 0);
|
||||
|
||||
const instance_bytes = @ptrCast([*]u8, alloc_ptr)[0..alloc_bytes];
|
||||
const instance = std.heap.FixedBufferAllocator.init(instance_bytes).allocator().create(Instance) catch unreachable;
|
||||
var fba = std.heap.FixedBufferAllocator.init(instance_bytes);
|
||||
const instance = fba.allocator().create(Instance) catch unreachable;
|
||||
instance.* = .{
|
||||
.fn_args = args,
|
||||
.thread = .{
|
||||
|
||||
Reference in New Issue
Block a user