| author | |
| committer | |
| log | b85ef656caa4d6845996d60a091332e9113d17e2 |
| tree | 6483ccf3d8b9639e8c862f2c473af8cbba373438 |
| parent | 0d22a00f6fde79f851a7d19c2096c07f541ed0be |
3 files changed, 21 insertions(+), 4 deletions(-)
src/ir.cpp+11| ... | ... | @@ -2647,6 +2647,17 @@ static IrInstruction *ir_build_coro_alloc_helper(IrBuilder *irb, Scope *scope, A |
| 2647 | 2647 | return &instruction->base; |
| 2648 | 2648 | } |
| 2649 | 2649 | |
| 2650 | static IrInstruction *ir_build_add_implicit_return_type(IrBuilder *irb, Scope *scope, AstNode *source_node, | |
| 2651 | IrInstruction *value) | |
| 2652 | { | |
| 2653 | IrInstructionAddImplicitReturnType *instruction = ir_build_instruction<IrInstructionAddImplicitReturnType>(irb, scope, source_node); | |
| 2654 | instruction->value = value; | |
| 2655 | ||
| 2656 | ir_ref_instruction(value, irb->current_basic_block); | |
| 2657 | ||
| 2658 | return &instruction->base; | |
| 2659 | } | |
| 2660 | ||
| 2650 | 2661 | static IrInstruction *ir_build_atomic_rmw(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| 2651 | 2662 | IrInstruction *operand_type, IrInstruction *ptr, IrInstruction *op, IrInstruction *operand, |
| 2652 | 2663 | IrInstruction *ordering, AtomicRmwOp resolved_op, AtomicOrder resolved_ordering) |
src/ir_print.cpp+6| ... | ... | @@ -1146,6 +1146,12 @@ static void ir_print_coro_alloc_helper(IrPrint *irp, IrInstructionCoroAllocHelpe |
| 1146 | 1146 | fprintf(irp->f, ")"); |
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | static void ir_print_add_implicit_return_type(IrPrint *irp, IrInstructionAddImplicitReturnType *instruction) { | |
| 1150 | fprintf(irp->f, "@addImplicitReturnType("); | |
| 1151 | ir_print_other_instruction(irp, instruction->value); | |
| 1152 | fprintf(irp->f, ")"); | |
| 1153 | } | |
| 1154 | ||
| 1149 | 1155 | static void ir_print_atomic_rmw(IrPrint *irp, IrInstructionAtomicRmw *instruction) { |
| 1150 | 1156 | fprintf(irp->f, "@atomicRmw("); |
| 1151 | 1157 | if (instruction->operand_type != nullptr) { |
std/event.zig+4-4| ... | ... | @@ -168,10 +168,10 @@ test "listen on a port, send bytes, receive bytes" { |
| 168 | 168 | var socket = *_socket; // TODO https://github.com/zig-lang/zig/issues/733 |
| 169 | 169 | defer socket.close(); |
| 170 | 170 | const next_handler = async errorableHandler(self, _addr, socket) catch |err| switch (err) { |
| 171 | error.OutOfMemory => return, | |
| 171 | error.OutOfMemory => @panic("unable to handle connection: out of memory"), | |
| 172 | 172 | }; |
| 173 | (await next_handler) catch |err| switch (err) { | |
| 174 | ||
| 173 | (await next_handler) catch |err| { | |
| 174 | std.debug.panic("unable to handle connection: {}\n", err); | |
| 175 | 175 | }; |
| 176 | 176 | suspend |p| { cancel p; } |
| 177 | 177 | } |
| ... | ... | @@ -184,7 +184,7 @@ test "listen on a port, send bytes, receive bytes" { |
| 184 | 184 | |
| 185 | 185 | var adapter = std.io.FileOutStream.init(&socket); |
| 186 | 186 | var stream = &adapter.stream; |
| 187 | try stream.print("hello from server\n") catch unreachable; | |
| 187 | try stream.print("hello from server\n"); | |
| 188 | 188 | } |
| 189 | 189 | }; |
| 190 | 190 |