| ... | @@ -8905,6 +8905,15 @@ static void create_test_compile_var_and_add_test_runner(CodeGen *g) { | ... | @@ -8905,6 +8905,15 @@ static void create_test_compile_var_and_add_test_runner(CodeGen *g) { |
| 8905 | for (size_t i = 0; i < g->test_fns.length; i += 1) { | 8905 | for (size_t i = 0; i < g->test_fns.length; i += 1) { |
| 8906 | ZigFn *test_fn_entry = g->test_fns.at(i); | 8906 | ZigFn *test_fn_entry = g->test_fns.at(i); |
| 8907 | | 8907 | |
| | 8908 | if (fn_is_async(test_fn_entry)) { |
| | 8909 | ErrorMsg *msg = add_node_error(g, test_fn_entry->proto_node, |
| | 8910 | buf_create_from_str("test functions cannot be async")); |
| | 8911 | add_error_note(g, msg, test_fn_entry->proto_node, |
| | 8912 | buf_sprintf("this restriction may be lifted in the future. See https://github.com/ziglang/zig/issues/3117 for more details")); |
| | 8913 | add_async_error_notes(g, msg, test_fn_entry); |
| | 8914 | continue; |
| | 8915 | } |
| | 8916 | |
| 8908 | ConstExprValue *this_val = &test_fn_array->data.x_array.data.s_none.elements[i]; | 8917 | ConstExprValue *this_val = &test_fn_array->data.x_array.data.s_none.elements[i]; |
| 8909 | this_val->special = ConstValSpecialStatic; | 8918 | this_val->special = ConstValSpecialStatic; |
| 8910 | this_val->type = struct_type; | 8919 | this_val->type = struct_type; |
| ... | @@ -8924,6 +8933,7 @@ static void create_test_compile_var_and_add_test_runner(CodeGen *g) { | ... | @@ -8924,6 +8933,7 @@ static void create_test_compile_var_and_add_test_runner(CodeGen *g) { |
| 8924 | fn_field->data.x_ptr.mut = ConstPtrMutComptimeConst; | 8933 | fn_field->data.x_ptr.mut = ConstPtrMutComptimeConst; |
| 8925 | fn_field->data.x_ptr.data.fn.fn_entry = test_fn_entry; | 8934 | fn_field->data.x_ptr.data.fn.fn_entry = test_fn_entry; |
| 8926 | } | 8935 | } |
| | 8936 | report_errors_and_maybe_exit(g); |
| 8927 | | 8937 | |
| 8928 | ConstExprValue *test_fn_slice = create_const_slice(g, test_fn_array, 0, g->test_fns.length, true); | 8938 | ConstExprValue *test_fn_slice = create_const_slice(g, test_fn_array, 0, g->test_fns.length, true); |
| 8929 | | 8939 | |