diff --git a/test/cases/compile_errors/address_of_threadlocal_not_comptime_known.zig b/test/cases/compile_errors/address_of_threadlocal_not_comptime_known.zig index 1a6b649094ab94b2e98312501635f2079cf71337..904a31cddb5a14f1f50dab6324678a1953d3c89a 100644 --- a/test/cases/compile_errors/address_of_threadlocal_not_comptime_known.zig +++ b/test/cases/compile_errors/address_of_threadlocal_not_comptime_known.zig @@ -10,5 +10,5 @@ pub export fn entry() void { // target=native // // :2:36: error: unable to resolve comptime value -// :2:36: note: global variable initializer must be comptime-known -// :2:36: note: thread local and dll imported variables have runtime-known addresses +// :2:36: note: initializer of container-level variable must be comptime-known +// :2:36: note: threadlocal and dll imported variables have runtime-known addresses diff --git a/test/cases/compile_errors/anytype_param_requires_comptime.zig b/test/cases/compile_errors/anytype_param_requires_comptime.zig index ddcb0a7b9b00a10858e2285328ecd760ba1980f5..94a08ac1194bf6ff81d2ec4274d459d3aaa63215 100644 --- a/test/cases/compile_errors/anytype_param_requires_comptime.zig +++ b/test/cases/compile_errors/anytype_param_requires_comptime.zig @@ -13,8 +13,8 @@ pub export fn entry() void { } // error -// backend=stage2 -// target=native // // :7:25: error: unable to resolve comptime value -// :7:25: note: initializer of comptime only struct must be comptime-known +// :7:25: note: initializer of comptime-only struct 'tmp.S.foo__anon_166.C' must be comptime-known +// :4:16: note: struct requires comptime because of this field +// :4:16: note: types are not available at runtime diff --git a/test/cases/compile_errors/array_mult_with_number_type.zig b/test/cases/compile_errors/array_mult_with_number_type.zig index bd47c3b56f7b4158d4cf177394eb1d98454c5f48..5c8b47f3256fde07b468e5d05952765b0faf1812 100644 --- a/test/cases/compile_errors/array_mult_with_number_type.zig +++ b/test/cases/compile_errors/array_mult_with_number_type.zig @@ -1,10 +1,9 @@ -export fn entry(base: f32, exponent: f32) f32 { +const exponent: f32 = 1.0; +export fn entry(base: f32) f32 { return base ** exponent; } // error -// backend=stage2 -// target=native // -// :2:12: error: expected indexable; found 'f32' -// :2:17: note: this operator multiplies arrays; use std.math.pow for exponentiation +// :3:12: error: expected indexable; found 'f32' +// :3:17: note: this operator multiplies arrays; use std.math.pow for exponentiation diff --git a/test/cases/compile_errors/asm_at_compile_time.zig b/test/cases/compile_errors/asm_at_compile_time.zig index 49624d68052b0933a2bfe9577ba2d48ee7b0fca7..1d588a7df4f1cfd94854c4583c3df77c0543763b 100644 --- a/test/cases/compile_errors/asm_at_compile_time.zig +++ b/test/cases/compile_errors/asm_at_compile_time.zig @@ -15,4 +15,5 @@ fn doSomeAsm() void { // target=native // // :6:5: error: unable to evaluate comptime expression -// :2:14: note: called from here +// :2:14: note: called at comptime from here +// :1:1: note: 'comptime' keyword forces comptime evaluation diff --git a/test/cases/compile_errors/attempted_double_pipe_on_boolean_values.zig b/test/cases/compile_errors/attempted_double_pipe_on_boolean_values.zig index 59b5bde8af6fd96ad8f89ea8591f18a13554b6e0..6cd4d0ebe8256e0e901232ac504769f2f05b2d7f 100644 --- a/test/cases/compile_errors/attempted_double_pipe_on_boolean_values.zig +++ b/test/cases/compile_errors/attempted_double_pipe_on_boolean_values.zig @@ -1,13 +1,11 @@ -export fn entry(a: bool, b: bool) i32 { - if (a || b) { +export fn entry() i32 { + if (true || false) { return 1234; } return 5678; } // error -// backend=stage2 -// target=native // // :2:9: error: expected error set type, found 'bool' -// :2:11: note: '||' merges error sets; 'or' performs boolean OR +// :2:14: note: '||' merges error sets; 'or' performs boolean OR diff --git a/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig b/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig index c072c7ef9d977c4ae5efb84f2021d247b68cdd24..6ff3e57154e9099fbf9eeda766310101f54d22a3 100644 --- a/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig +++ b/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig @@ -20,4 +20,6 @@ pub export fn entry2() void { // // :5:15: error: unable to evaluate comptime expression // :5:13: note: operation is runtime due to this operand +// :4:72: note: '@shuffle' mask must be comptime-known // :13:11: error: unable to evaluate comptime expression +// :12:72: note: '@shuffle' mask must be comptime-known diff --git a/test/cases/compile_errors/builtin_extern_in_comptime_scope.zig b/test/cases/compile_errors/builtin_extern_in_comptime_scope.zig index 4a85ee8aab391fdc470c711a2e2f1f0c365f0260..66951a03a009a28e94f7c1e255e1074848c1f5a9 100644 --- a/test/cases/compile_errors/builtin_extern_in_comptime_scope.zig +++ b/test/cases/compile_errors/builtin_extern_in_comptime_scope.zig @@ -11,8 +11,8 @@ pub export fn entry2() void { // target=native // // :1:16: error: unable to resolve comptime value -// :1:16: note: global variable initializer must be comptime-known -// :1:16: note: thread local and dll imported variables have runtime-known addresses +// :1:16: note: initializer of container-level variable must be comptime-known +// :1:16: note: threadlocal and dll imported variables have runtime-known addresses // :2:17: error: unable to resolve comptime value -// :2:17: note: global variable initializer must be comptime-known -// :2:17: note: thread local and dll imported variables have runtime-known addresses +// :2:17: note: initializer of container-level variable must be comptime-known +// :2:17: note: threadlocal and dll imported variables have runtime-known addresses diff --git a/test/cases/compile_errors/compile_time_struct_field.zig b/test/cases/compile_errors/compile_time_struct_field.zig index 8ca502f645a03e2ef25aeb67d1db91390094496a..adfcc440e66f200ed2e3b48ee91a4beb6f0bd425 100644 --- a/test/cases/compile_errors/compile_time_struct_field.zig +++ b/test/cases/compile_errors/compile_time_struct_field.zig @@ -4,16 +4,15 @@ const S = struct { }; export fn a() void { - var value: u32 = 3; - const comptimeStruct = S { - .normal_ptr = &value, - }; - _ = comptimeStruct; + var value: u32 = 3; + const comptimeStruct = S{ + .normal_ptr = &value, + }; + _ = comptimeStruct; } // error -// backend=stage2 -// target=native // -// 9:6: error: unable to resolve comptime value -// 9:6: note: initializer of comptime only struct must be comptime-known +// :9:10: error: unable to resolve comptime value +// :9:10: note: initializer of comptime-only struct 'tmp.S' must be comptime-known +// :2:21: note: struct requires comptime because of this field diff --git a/test/cases/compile_errors/condition_comptime_reason_explained.zig b/test/cases/compile_errors/condition_comptime_reason_explained.zig index 2e9c47522aed9ba8728352ac5e77a3106a193f2d..d641b6176ba7566ca330514a453300a6aa04ec3f 100644 --- a/test/cases/compile_errors/condition_comptime_reason_explained.zig +++ b/test/cases/compile_errors/condition_comptime_reason_explained.zig @@ -33,18 +33,14 @@ pub export fn entry2() void { } // error -// backend=stage2 -// target=native // // :8:9: error: unable to resolve comptime value -// :8:9: note: condition in comptime branch must be comptime-known -// :7:13: note: expression is evaluated at comptime because the function returns a comptime-only type 'tmp.S' +// :19:15: note: called at comptime from here +// :7:13: note: function with comptime-only return type 'tmp.S' is evaluated at comptime // :2:12: note: struct requires comptime because of this field // :2:12: note: use '*const fn () void' for a function pointer type -// :19:15: note: called from here // :22:13: error: unable to resolve comptime value -// :22:13: note: condition in comptime switch must be comptime-known -// :21:17: note: expression is evaluated at comptime because the function returns a comptime-only type 'tmp.S' +// :32:19: note: called at comptime from here +// :21:17: note: function with comptime-only return type 'tmp.S' is evaluated at comptime // :2:12: note: struct requires comptime because of this field // :2:12: note: use '*const fn () void' for a function pointer type -// :32:19: note: called from here diff --git a/test/cases/compile_errors/enum_backed_by_comptime_int_must_be_casted_from_comptime_value.zig b/test/cases/compile_errors/enum_backed_by_comptime_int_must_be_casted_from_comptime_value.zig index e259bb5634ca6502bc64b2ce942c210b244dd8ac..eab95cd9da26496514c2c264a37fd25297633640 100644 --- a/test/cases/compile_errors/enum_backed_by_comptime_int_must_be_casted_from_comptime_value.zig +++ b/test/cases/compile_errors/enum_backed_by_comptime_int_must_be_casted_from_comptime_value.zig @@ -11,4 +11,4 @@ export fn entry() void { // target=native // // :6:31: error: unable to resolve comptime value -// :6:31: note: value being casted to enum with 'comptime_int' tag type must be comptime-known +// :6:31: note: value casted to enum with 'comptime_int' tag type must be comptime-known diff --git a/test/cases/compile_errors/error_in_typeof_param.zig b/test/cases/compile_errors/error_in_typeof_param.zig index 073bd29bc30284112272e66274893f8841f913e3..469c9e5e1eaf1a1f9774b7230d803deca4eb0d93 100644 --- a/test/cases/compile_errors/error_in_typeof_param.zig +++ b/test/cases/compile_errors/error_in_typeof_param.zig @@ -11,4 +11,4 @@ pub export fn entry() void { // target=native // // :6:31: error: unable to resolve comptime value -// :6:31: note: value being casted to 'comptime_int' must be comptime-known +// :6:31: note: value casted to 'comptime_int' must be comptime-known diff --git a/test/cases/compile_errors/explain_why_fn_is_called_at_comptime.zig b/test/cases/compile_errors/explain_why_fn_is_called_at_comptime.zig index e8232543a39e43d59b4b806ecfed627b76ca7093..7901808f3c9da9cf5312f1ec14c9d65c21f1190d 100644 --- a/test/cases/compile_errors/explain_why_fn_is_called_at_comptime.zig +++ b/test/cases/compile_errors/explain_why_fn_is_called_at_comptime.zig @@ -4,7 +4,7 @@ const S = struct { }; fn bar() void {} -fn foo(comptime a: *u8) S { +fn foo(a: *u8) S { return .{ .fnPtr = bar, .a = a.* }; } pub export fn entry() void { @@ -13,11 +13,8 @@ pub export fn entry() void { } // error -// backend=stage2 -// target=native // // :12:13: error: unable to resolve comptime value -// :12:13: note: argument to function being called at comptime must be comptime-known -// :7:25: note: expression is evaluated at comptime because the function returns a comptime-only type 'tmp.S' +// :7:16: note: function with comptime-only return type 'tmp.S' is evaluated at comptime // :2:12: note: struct requires comptime because of this field // :2:12: note: use '*const fn () void' for a function pointer type diff --git a/test/cases/compile_errors/explain_why_generic_fn_is_called_at_comptime.zig b/test/cases/compile_errors/explain_why_generic_fn_is_called_at_comptime.zig index aada601c79bf49a4183292a28b23610bedfddb59..cfec89d5a785f21a98381d37131d94641b1c6a3a 100644 --- a/test/cases/compile_errors/explain_why_generic_fn_is_called_at_comptime.zig +++ b/test/cases/compile_errors/explain_why_generic_fn_is_called_at_comptime.zig @@ -15,9 +15,8 @@ pub export fn entry() void { _ = foo(a, fn () void); } // error -// backend=stage2 -// target=native // // :15:13: error: unable to resolve comptime value -// :15:13: note: argument to function being called at comptime must be comptime-known -// :9:38: note: expression is evaluated at comptime because the generic function was instantiated with a comptime-only return type +// :9:38: note: generic function instantiated with comptime-only return type 'tmp.S(fn () void)' is evaluated at comptime +// :3:16: note: struct requires comptime because of this field +// :3:16: note: use '*const fn () void' for a function pointer type diff --git a/test/cases/compile_errors/global_var_struct_init_in_comptim_block.zig b/test/cases/compile_errors/global_var_struct_init_in_comptim_block.zig deleted file mode 100644 index 2ffb3747fe13667520208b8e05528cb0b251e5ad..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/global_var_struct_init_in_comptim_block.zig +++ /dev/null @@ -1,14 +0,0 @@ -const Foo = struct { - x: i32, -}; -var x: Foo = .{ .x = 2 }; -comptime { - x = .{ .x = 3 }; -} - -// error -// backend=stage2 -// target=native -// -// :6:17: error: unable to evaluate comptime expression -// :6:17: note: operation is runtime due to this operand diff --git a/test/cases/compile_errors/global_var_struct_init_in_comptime_block.zig b/test/cases/compile_errors/global_var_struct_init_in_comptime_block.zig new file mode 100644 index 0000000000000000000000000000000000000000..000fe434186b3d6288bbe6b9ff538a1782de80db --- /dev/null +++ b/test/cases/compile_errors/global_var_struct_init_in_comptime_block.zig @@ -0,0 +1,15 @@ +const Foo = struct { + x: i32, +}; +var x: Foo = .{ .x = 2 }; +comptime { + x = .{ .x = 3 }; +} + +// error +// backend=stage2 +// target=native +// +// :6:17: error: unable to evaluate comptime expression +// :6:17: note: operation is runtime due to this operand +// :5:1: note: 'comptime' keyword forces comptime evaluation diff --git a/test/cases/compile_errors/global_variable_stored_in_global_const.zig b/test/cases/compile_errors/global_variable_stored_in_global_const.zig index 594498f1c186a905b6f843eabaa667e73cc243c0..b7990f65ffe9b7056375af0f8c1863c3efb6c4ca 100644 --- a/test/cases/compile_errors/global_variable_stored_in_global_const.zig +++ b/test/cases/compile_errors/global_variable_stored_in_global_const.zig @@ -5,8 +5,6 @@ pub export fn entry() void { } // error -// backend=stage2 -// target=native // // :2:11: error: unable to resolve comptime value -// :2:11: note: global variable initializer must be comptime-known +// :2:11: note: initializer of container-level variable must be comptime-known diff --git a/test/cases/compile_errors/incorrect_pointer_dereference_syntax.zig b/test/cases/compile_errors/incorrect_pointer_dereference_syntax.zig index 4f80b6186507f588894d291821a3a189ca388052..04f4ddf2897f8a743c25fa0e532836bc0e3db3ef 100644 --- a/test/cases/compile_errors/incorrect_pointer_dereference_syntax.zig +++ b/test/cases/compile_errors/incorrect_pointer_dereference_syntax.zig @@ -1,12 +1,9 @@ pub export fn entry() void { - var a: *u32 = undefined; + const a: *u32 = undefined; _ = *a; - _ = &a; } // error -// backend=stage2 -// target=native // // :3:10: error: expected type 'type', found '*u32' // :3:10: note: use '.*' to dereference pointer diff --git a/test/cases/compile_errors/inline_call_runtime_value_to_comptime_param.zig b/test/cases/compile_errors/inline_call_runtime_value_to_comptime_param.zig index 2b3738cd2f7e6f0e37f3617f4f709ed701e8e713..67079c8a2dad42bccb79937a5b42f9972a820f68 100644 --- a/test/cases/compile_errors/inline_call_runtime_value_to_comptime_param.zig +++ b/test/cases/compile_errors/inline_call_runtime_value_to_comptime_param.zig @@ -14,4 +14,4 @@ pub export fn entry() void { // target=native // // :5:18: error: unable to resolve comptime value -// :5:18: note: parameter is comptime +// :5:18: note: argument to comptime parameter must be comptime-known diff --git a/test/cases/compile_errors/int-float_conversion_to_comptime_int-float.zig b/test/cases/compile_errors/int-float_conversion_to_comptime_int-float.zig index d6bf372a88ce5554f3da12d2768bc132cde3555c..4b118664c56d9abe46888e3eae685688baf745ff 100644 --- a/test/cases/compile_errors/int-float_conversion_to_comptime_int-float.zig +++ b/test/cases/compile_errors/int-float_conversion_to_comptime_int-float.zig @@ -10,10 +10,8 @@ export fn bar() void { } // error -// backend=stage2 -// target=native // // :4:41: error: unable to resolve comptime value -// :4:41: note: value being casted to 'comptime_int' must be comptime-known +// :4:41: note: value casted to 'comptime_int' must be comptime-known // :9:43: error: unable to resolve comptime value -// :9:43: note: value being casted to 'comptime_float' must be comptime-known +// :9:43: note: value casted to 'comptime_float' must be comptime-known diff --git a/test/cases/compile_errors/non-const_expression_function_call_with_struct_return_value_outside_function.zig b/test/cases/compile_errors/non-const_expression_function_call_with_struct_return_value_outside_function.zig index d9bd0dd2b22319279e310acc563b15eed7236f8e..ad3c9325acf3129a2bfbd58ffa45da2eee3ae413 100644 --- a/test/cases/compile_errors/non-const_expression_function_call_with_struct_return_value_outside_function.zig +++ b/test/cases/compile_errors/non-const_expression_function_call_with_struct_return_value_outside_function.zig @@ -13,9 +13,8 @@ export fn entry() usize { } // error -// backend=stage2 -// target=native // // :6:24: error: unable to evaluate comptime expression // :6:5: note: operation is runtime due to this operand -// :4:17: note: called from here +// :4:17: note: called at comptime from here +// :4:17: note: initializer of container-level variable must be comptime-known diff --git a/test/cases/compile_errors/non-pure_function_returns_type.zig b/test/cases/compile_errors/non-pure_function_returns_type.zig index d7d07668d433d5876464b04e5a8a64df2b8b0b88..3b83c73b6ce5f5afa67928aa983ca6b7029decb1 100644 --- a/test/cases/compile_errors/non-pure_function_returns_type.zig +++ b/test/cases/compile_errors/non-pure_function_returns_type.zig @@ -23,4 +23,5 @@ export fn function_with_return_type_type() void { // // :3:7: error: unable to evaluate comptime expression // :3:5: note: operation is runtime due to this operand -// :16:19: note: called from here +// :16:19: note: called at comptime from here +// :16:19: note: types must be comptime-known diff --git a/test/cases/compile_errors/non_comptime_param_in_comptime_function.zig b/test/cases/compile_errors/non_comptime_param_in_comptime_function.zig index a902ffe9399ae84d71ed31915d2855da3b3b2247..cfb68bbcf6f53452e81e9ff67feb395078c966ec 100644 --- a/test/cases/compile_errors/non_comptime_param_in_comptime_function.zig +++ b/test/cases/compile_errors/non_comptime_param_in_comptime_function.zig @@ -9,10 +9,7 @@ export fn entry() void { } // error -// backend=stage2 -// target=native // // :8:11: error: unable to resolve comptime value -// :8:11: note: argument to function being called at comptime must be comptime-known -// :1:20: note: expression is evaluated at comptime because the function returns a comptime-only type 'type' +// :1:20: note: function with comptime-only return type 'type' is evaluated at comptime // :1:20: note: types are not available at runtime diff --git a/test/cases/compile_errors/non_constant_expression_in_array_size.zig b/test/cases/compile_errors/non_constant_expression_in_array_size.zig index 70d1655eb7b25fbc4bd771a34a928dc200cd42aa..cbc0455bc3483e4f03e422dc44d6317e348b21da 100644 --- a/test/cases/compile_errors/non_constant_expression_in_array_size.zig +++ b/test/cases/compile_errors/non_constant_expression_in_array_size.zig @@ -15,5 +15,5 @@ export fn entry() usize { // target=native // // :6:12: error: unable to resolve comptime value -// :6:12: note: value being returned at comptime must be comptime-known -// :2:12: note: called from here +// :2:12: note: called at comptime from here +// :1:13: note: struct fields must be comptime-known diff --git a/test/cases/compile_errors/runtime_assignment_to_comptime_struct_type.zig b/test/cases/compile_errors/runtime_assignment_to_comptime_struct_type.zig index c2bec83afdd3c2e1733256f63c52758a82561e03..38ab6a7566c266b5c30413f45137c6dbb7b7f26c 100644 --- a/test/cases/compile_errors/runtime_assignment_to_comptime_struct_type.zig +++ b/test/cases/compile_errors/runtime_assignment_to_comptime_struct_type.zig @@ -10,8 +10,8 @@ export fn f() void { } // error -// backend=stage2 -// target=native // // :7:23: error: unable to resolve comptime value -// :7:23: note: initializer of comptime only struct must be comptime-known +// :7:23: note: initializer of comptime-only struct 'tmp.Foo' must be comptime-known +// :3:10: note: struct requires comptime because of this field +// :3:10: note: types are not available at runtime diff --git a/test/cases/compile_errors/runtime_assignment_to_comptime_union_type.zig b/test/cases/compile_errors/runtime_assignment_to_comptime_union_type.zig index 21b00ac545fc743ac473266f838a753528b7acdb..a198ff8e73bf46b5832d61aca012cb6a6b01da7d 100644 --- a/test/cases/compile_errors/runtime_assignment_to_comptime_union_type.zig +++ b/test/cases/compile_errors/runtime_assignment_to_comptime_union_type.zig @@ -10,8 +10,8 @@ export fn f() void { } // error -// backend=stage2 -// target=native // // :8:23: error: unable to resolve comptime value -// :8:23: note: initializer of comptime only union must be comptime-known +// :8:23: note: initializer of comptime-only union 'tmp.Foo' must be comptime-known +// :3:10: note: union requires comptime because of this field +// :3:10: note: types are not available at runtime diff --git a/test/cases/compile_errors/runtime_to_comptime_num.zig b/test/cases/compile_errors/runtime_to_comptime_num.zig index eb5d5fc6309d20ac65e00816a54cf07ffaf1e153..4cf24ceb17698928de1282417a4b21c8988f41e5 100644 --- a/test/cases/compile_errors/runtime_to_comptime_num.zig +++ b/test/cases/compile_errors/runtime_to_comptime_num.zig @@ -26,10 +26,10 @@ pub export fn entry4() void { // target=native // // :4:27: error: unable to resolve comptime value -// :4:27: note: value being casted to 'comptime_int' must be comptime-known +// :4:27: note: value casted to 'comptime_int' must be comptime-known // :9:29: error: unable to resolve comptime value -// :9:29: note: value being casted to 'comptime_float' must be comptime-known +// :9:29: note: value casted to 'comptime_float' must be comptime-known // :15:10: error: unable to resolve comptime value -// :15:10: note: value being casted to 'comptime_float' must be comptime-known +// :15:10: note: value casted to 'comptime_float' must be comptime-known // :21:10: error: unable to resolve comptime value -// :21:10: note: value being casted to 'comptime_int' must be comptime-known +// :21:10: note: value casted to 'comptime_int' must be comptime-known diff --git a/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig b/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig index 8b43842f230b4cac69e850019ed192d47c0055d0..6038b4ea260fd436e08918467e506e9d66126aff 100644 --- a/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig +++ b/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig @@ -31,13 +31,13 @@ export fn entry2() void { // error // -// :5:12: error: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] -// :9:13: error: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] +// :5:12: error: slice of single-item pointer must be bounded +// :9:13: error: slice of single-item pointer must have bounds [0..0], [0..1], or [1..1] // :9:13: note: expected '0', found '1' -// :13:16: error: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] +// :13:16: error: slice of single-item pointer must have bounds [0..0], [0..1], or [1..1] // :13:16: note: expected '1', found '2' // :17:16: error: end index 2 out of bounds for slice of single-item pointer // :23:13: error: unable to resolve comptime value -// :23:13: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] +// :23:13: note: slice of single-item pointer must have comptime-known bounds // :29:16: error: unable to resolve comptime value -// :29:16: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] +// :29:16: note: slice of single-item pointer must have comptime-known bounds diff --git a/test/cases/compile_errors/unable_to_evaluate_comptime_expr.zig b/test/cases/compile_errors/unable_to_evaluate_comptime_expr.zig index a383961cf467447931b927b5a259fec03f92159d..561b39a4e817f3f60d2c87327f5d184821d31e4f 100644 --- a/test/cases/compile_errors/unable_to_evaluate_comptime_expr.zig +++ b/test/cases/compile_errors/unable_to_evaluate_comptime_expr.zig @@ -33,12 +33,13 @@ pub export fn entry3() void { } // error -// backend=stage2 -// target=native // // :7:13: error: unable to evaluate comptime expression // :7:16: note: operation is runtime due to this operand +// :7:13: note: initializer of container-level variable must be comptime-known // :13:13: error: unable to evaluate comptime expression // :13:16: note: operation is runtime due to this operand +// :13:13: note: initializer of container-level variable must be comptime-known // :22:9: error: unable to evaluate comptime expression // :22:21: note: operation is runtime due to this operand +// :21:13: note: enum fields must be comptime-known diff --git a/test/cases/compile_errors/unable_to_evaluate_expr_inside_cimport.zig b/test/cases/compile_errors/unable_to_evaluate_expr_inside_cimport.zig index 9460a58993037d74f4d32270b42a751a16313510..ab98dcd673e2ccf6423541c8269cd646f7995209 100644 --- a/test/cases/compile_errors/unable_to_evaluate_expr_inside_cimport.zig +++ b/test/cases/compile_errors/unable_to_evaluate_expr_inside_cimport.zig @@ -12,4 +12,4 @@ export fn entry() void { // // :2:11: error: unable to evaluate comptime expression // :2:13: note: operation is runtime due to this operand -// :1:11: note: expression is evaluated at comptime because it is inside a @cImport +// :1:11: note: operand to '@cImport' is evaluated at comptime diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 447984d2779a95950527c830bb9de46ada28332e..f566464bac7737d4207f9c6d91ca4930f0341224 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -57,8 +57,8 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void { \\} , &[_][]const u8{ ":3:12: error: unable to resolve comptime value", - ":3:12: note: argument to function being called at comptime must be comptime-known", - ":2:55: note: expression is evaluated at comptime because the generic function was instantiated with a comptime-only return type", + ":2:55: note: generic function instantiated with comptime-only return type '?fn () void' is evaluated at comptime", + ":2:55: note: use '*const fn () void' for a function pointer type", }); case.addSourceFile("b.zig", \\pub const ElfDynLib = struct { @@ -198,7 +198,9 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void { ":8:36: error: runtime-known argument passed to comptime parameter", ":2:41: note: declared comptime here", ":13:32: error: unable to resolve comptime value", - ":13:32: note: initializer of comptime only struct must be comptime-known", + ":13:32: note: initializer of comptime-only struct 'tmp.callAnytypeFunctionWithRuntimeComptimeOnlyType.S' must be comptime-known", + ":12:35: note: struct requires comptime because of this field", + ":12:35: note: types are not available at runtime", }); case.addSourceFile("import.zig",