authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-01 21:27:55-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-01 21:27:55-05:00
log37caa56fbc04d314aa8fe5df6bc80c42d879dd7e
treef1b64879d38563b2cc49ec742d33b95d24427e40
parentc32e50f5058dd3720db24706391c994545d13640
signaturelock-open Commit is signed but in an unrecognized format.

fix docs regressions


3 files changed, 38 insertions(+), 37 deletions(-)

doc/docgen.zig+16-16
...@@ -1039,7 +1039,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1039,7 +1039,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1039 const name_plus_ext = try std.fmt.allocPrint(allocator, "{}.zig", code.name);1039 const name_plus_ext = try std.fmt.allocPrint(allocator, "{}.zig", code.name);
1040 const tmp_source_file_name = try fs.path.join(1040 const tmp_source_file_name = try fs.path.join(
1041 allocator,1041 allocator,
1042 [_][]const u8{ tmp_dir_name, name_plus_ext },1042 &[_][]const u8{ tmp_dir_name, name_plus_ext },
1043 );1043 );
1044 try io.writeFile(tmp_source_file_name, trimmed_raw_source);1044 try io.writeFile(tmp_source_file_name, trimmed_raw_source);
10451045
...@@ -1048,7 +1048,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1048,7 +1048,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1048 const name_plus_bin_ext = try std.fmt.allocPrint(allocator, "{}{}", code.name, exe_ext);1048 const name_plus_bin_ext = try std.fmt.allocPrint(allocator, "{}{}", code.name, exe_ext);
1049 var build_args = std.ArrayList([]const u8).init(allocator);1049 var build_args = std.ArrayList([]const u8).init(allocator);
1050 defer build_args.deinit();1050 defer build_args.deinit();
1051 try build_args.appendSlice([_][]const u8{1051 try build_args.appendSlice(&[_][]const u8{
1052 zig_exe,1052 zig_exe,
1053 "build-exe",1053 "build-exe",
1054 tmp_source_file_name,1054 tmp_source_file_name,
...@@ -1079,7 +1079,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1079,7 +1079,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1079 const name_with_ext = try std.fmt.allocPrint(allocator, "{}{}", link_object, obj_ext);1079 const name_with_ext = try std.fmt.allocPrint(allocator, "{}{}", link_object, obj_ext);
1080 const full_path_object = try fs.path.join(1080 const full_path_object = try fs.path.join(
1081 allocator,1081 allocator,
1082 [_][]const u8{ tmp_dir_name, name_with_ext },1082 &[_][]const u8{ tmp_dir_name, name_with_ext },
1083 );1083 );
1084 try build_args.append("--object");1084 try build_args.append("--object");
1085 try build_args.append(full_path_object);1085 try build_args.append(full_path_object);
...@@ -1090,7 +1090,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1090,7 +1090,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1090 try out.print(" -lc");1090 try out.print(" -lc");
1091 }1091 }
1092 if (code.target_str) |triple| {1092 if (code.target_str) |triple| {
1093 try build_args.appendSlice([_][]const u8{ "-target", triple });1093 try build_args.appendSlice(&[_][]const u8{ "-target", triple });
1094 if (!code.is_inline) {1094 if (!code.is_inline) {
1095 try out.print(" -target {}", triple);1095 try out.print(" -target {}", triple);
1096 }1096 }
...@@ -1143,7 +1143,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1143,7 +1143,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1143 }1143 }
11441144
1145 const path_to_exe = mem.trim(u8, exec_result.stdout, " \r\n");1145 const path_to_exe = mem.trim(u8, exec_result.stdout, " \r\n");
1146 const run_args = [_][]const u8{path_to_exe};1146 const run_args = &[_][]const u8{path_to_exe};
11471147
1148 var exited_with_signal = false;1148 var exited_with_signal = false;
11491149
...@@ -1184,7 +1184,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1184,7 +1184,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1184 var test_args = std.ArrayList([]const u8).init(allocator);1184 var test_args = std.ArrayList([]const u8).init(allocator);
1185 defer test_args.deinit();1185 defer test_args.deinit();
11861186
1187 try test_args.appendSlice([_][]const u8{1187 try test_args.appendSlice(&[_][]const u8{
1188 zig_exe,1188 zig_exe,
1189 "test",1189 "test",
1190 tmp_source_file_name,1190 tmp_source_file_name,
...@@ -1212,7 +1212,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1212,7 +1212,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1212 try out.print(" -lc");1212 try out.print(" -lc");
1213 }1213 }
1214 if (code.target_str) |triple| {1214 if (code.target_str) |triple| {
1215 try test_args.appendSlice([_][]const u8{ "-target", triple });1215 try test_args.appendSlice(&[_][]const u8{ "-target", triple });
1216 try out.print(" -target {}", triple);1216 try out.print(" -target {}", triple);
1217 }1217 }
1218 const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed");1218 const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed");
...@@ -1224,7 +1224,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1224,7 +1224,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1224 var test_args = std.ArrayList([]const u8).init(allocator);1224 var test_args = std.ArrayList([]const u8).init(allocator);
1225 defer test_args.deinit();1225 defer test_args.deinit();
12261226
1227 try test_args.appendSlice([_][]const u8{1227 try test_args.appendSlice(&[_][]const u8{
1228 zig_exe,1228 zig_exe,
1229 "test",1229 "test",
1230 "--color",1230 "--color",
...@@ -1283,7 +1283,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1283,7 +1283,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1283 var test_args = std.ArrayList([]const u8).init(allocator);1283 var test_args = std.ArrayList([]const u8).init(allocator);
1284 defer test_args.deinit();1284 defer test_args.deinit();
12851285
1286 try test_args.appendSlice([_][]const u8{1286 try test_args.appendSlice(&[_][]const u8{
1287 zig_exe,1287 zig_exe,
1288 "test",1288 "test",
1289 tmp_source_file_name,1289 tmp_source_file_name,
...@@ -1345,7 +1345,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1345,7 +1345,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1345 const name_plus_obj_ext = try std.fmt.allocPrint(allocator, "{}{}", code.name, obj_ext);1345 const name_plus_obj_ext = try std.fmt.allocPrint(allocator, "{}{}", code.name, obj_ext);
1346 const tmp_obj_file_name = try fs.path.join(1346 const tmp_obj_file_name = try fs.path.join(
1347 allocator,1347 allocator,
1348 [_][]const u8{ tmp_dir_name, name_plus_obj_ext },1348 &[_][]const u8{ tmp_dir_name, name_plus_obj_ext },
1349 );1349 );
1350 var build_args = std.ArrayList([]const u8).init(allocator);1350 var build_args = std.ArrayList([]const u8).init(allocator);
1351 defer build_args.deinit();1351 defer build_args.deinit();
...@@ -1353,10 +1353,10 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1353,10 +1353,10 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1353 const name_plus_h_ext = try std.fmt.allocPrint(allocator, "{}.h", code.name);1353 const name_plus_h_ext = try std.fmt.allocPrint(allocator, "{}.h", code.name);
1354 const output_h_file_name = try fs.path.join(1354 const output_h_file_name = try fs.path.join(
1355 allocator,1355 allocator,
1356 [_][]const u8{ tmp_dir_name, name_plus_h_ext },1356 &[_][]const u8{ tmp_dir_name, name_plus_h_ext },
1357 );1357 );
13581358
1359 try build_args.appendSlice([_][]const u8{1359 try build_args.appendSlice(&[_][]const u8{
1360 zig_exe,1360 zig_exe,
1361 "build-obj",1361 "build-obj",
1362 tmp_source_file_name,1362 tmp_source_file_name,
...@@ -1395,7 +1395,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1395,7 +1395,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1395 }1395 }
13961396
1397 if (code.target_str) |triple| {1397 if (code.target_str) |triple| {
1398 try build_args.appendSlice([_][]const u8{ "-target", triple });1398 try build_args.appendSlice(&[_][]const u8{ "-target", triple });
1399 try out.print(" -target {}", triple);1399 try out.print(" -target {}", triple);
1400 }1400 }
14011401
...@@ -1442,7 +1442,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1442,7 +1442,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1442 var test_args = std.ArrayList([]const u8).init(allocator);1442 var test_args = std.ArrayList([]const u8).init(allocator);
1443 defer test_args.deinit();1443 defer test_args.deinit();
14441444
1445 try test_args.appendSlice([_][]const u8{1445 try test_args.appendSlice(&[_][]const u8{
1446 zig_exe,1446 zig_exe,
1447 "build-lib",1447 "build-lib",
1448 tmp_source_file_name,1448 tmp_source_file_name,
...@@ -1466,7 +1466,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1466,7 +1466,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1466 },1466 },
1467 }1467 }
1468 if (code.target_str) |triple| {1468 if (code.target_str) |triple| {
1469 try test_args.appendSlice([_][]const u8{ "-target", triple });1469 try test_args.appendSlice(&[_][]const u8{ "-target", triple });
1470 try out.print(" -target {}", triple);1470 try out.print(" -target {}", triple);
1471 }1471 }
1472 const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed");1472 const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed");
...@@ -1507,7 +1507,7 @@ fn exec(allocator: *mem.Allocator, env_map: *std.BufMap, args: []const []const u...@@ -1507,7 +1507,7 @@ fn exec(allocator: *mem.Allocator, env_map: *std.BufMap, args: []const []const u
1507}1507}
15081508
1509fn getBuiltinCode(allocator: *mem.Allocator, env_map: *std.BufMap, zig_exe: []const u8) ![]const u8 {1509fn getBuiltinCode(allocator: *mem.Allocator, env_map: *std.BufMap, zig_exe: []const u8) ![]const u8 {
1510 const result = try exec(allocator, env_map, [_][]const u8{1510 const result = try exec(allocator, env_map, &[_][]const u8{
1511 zig_exe,1511 zig_exe,
1512 "builtin",1512 "builtin",
1513 });1513 });
doc/langref.html.in+21-21
...@@ -1518,7 +1518,7 @@ value == null{#endsyntax#}</pre>...@@ -1518,7 +1518,7 @@ value == null{#endsyntax#}</pre>
1518const array1 = [_]u32{1,2};1518const array1 = [_]u32{1,2};
1519const array2 = [_]u32{3,4};1519const array2 = [_]u32{3,4};
1520const together = array1 ++ array2;1520const together = array1 ++ array2;
1521mem.eql(u32, together, [_]u32{1,2,3,4}){#endsyntax#}</pre>1521mem.eql(u32, together, &[_]u32{1,2,3,4}){#endsyntax#}</pre>
1522 </td>1522 </td>
1523 </tr>1523 </tr>
1524 <tr>1524 <tr>
...@@ -1621,10 +1621,10 @@ comptime {...@@ -1621,10 +1621,10 @@ comptime {
1621}1621}
16221622
1623// A string literal is a pointer to an array literal.1623// A string literal is a pointer to an array literal.
1624const same_message = "hello".*;1624const same_message = "hello";
16251625
1626comptime {1626comptime {
1627 assert(mem.eql(u8, message, same_message));1627 assert(mem.eql(u8, &message, same_message));
1628}1628}
16291629
1630test "iterate over an array" {1630test "iterate over an array" {
...@@ -1652,7 +1652,7 @@ const part_one = [_]i32{ 1, 2, 3, 4 };...@@ -1652,7 +1652,7 @@ const part_one = [_]i32{ 1, 2, 3, 4 };
1652const part_two = [_]i32{ 5, 6, 7, 8 };1652const part_two = [_]i32{ 5, 6, 7, 8 };
1653const all_of_it = part_one ++ part_two;1653const all_of_it = part_one ++ part_two;
1654comptime {1654comptime {
1655 assert(mem.eql(i32, all_of_it, [_]i32{ 1, 2, 3, 4, 5, 6, 7, 8 }));1655 assert(mem.eql(i32, &all_of_it, &[_]i32{ 1, 2, 3, 4, 5, 6, 7, 8 }));
1656}1656}
16571657
1658// remember that string literals are arrays1658// remember that string literals are arrays
...@@ -4915,30 +4915,30 @@ const assert = std.debug.assert;...@@ -4915,30 +4915,30 @@ const assert = std.debug.assert;
4915// https://github.com/ziglang/zig/issues/265 is implemented.4915// https://github.com/ziglang/zig/issues/265 is implemented.
4916test "[N]T to []const T" {4916test "[N]T to []const T" {
4917 var x1: []const u8 = "hello";4917 var x1: []const u8 = "hello";
4918 var x2: []const u8 = [5]u8{ 'h', 'e', 'l', 'l', 111 };4918 var x2: []const u8 = &[5]u8{ 'h', 'e', 'l', 'l', 111 };
4919 assert(std.mem.eql(u8, x1, x2));4919 assert(std.mem.eql(u8, x1, x2));
49204920
4921 var y: []const f32 = [2]f32{ 1.2, 3.4 };4921 var y: []const f32 = &[2]f32{ 1.2, 3.4 };
4922 assert(y[0] == 1.2);4922 assert(y[0] == 1.2);
4923}4923}
49244924
4925// Likewise, it works when the destination type is an error union.4925// Likewise, it works when the destination type is an error union.
4926test "[N]T to E![]const T" {4926test "[N]T to E![]const T" {
4927 var x1: anyerror![]const u8 = "hello";4927 var x1: anyerror![]const u8 = "hello";
4928 var x2: anyerror![]const u8 = [5]u8{ 'h', 'e', 'l', 'l', 111 };4928 var x2: anyerror![]const u8 = &[5]u8{ 'h', 'e', 'l', 'l', 111 };
4929 assert(std.mem.eql(u8, try x1, try x2));4929 assert(std.mem.eql(u8, try x1, try x2));
49304930
4931 var y: anyerror![]const f32 = [2]f32{ 1.2, 3.4 };4931 var y: anyerror![]const f32 = &[2]f32{ 1.2, 3.4 };
4932 assert((try y)[0] == 1.2);4932 assert((try y)[0] == 1.2);
4933}4933}
49344934
4935// Likewise, it works when the destination type is an optional.4935// Likewise, it works when the destination type is an optional.
4936test "[N]T to ?[]const T" {4936test "[N]T to ?[]const T" {
4937 var x1: ?[]const u8 = "hello";4937 var x1: ?[]const u8 = "hello";
4938 var x2: ?[]const u8 = [5]u8{ 'h', 'e', 'l', 'l', 111 };4938 var x2: ?[]const u8 = &[5]u8{ 'h', 'e', 'l', 'l', 111 };
4939 assert(std.mem.eql(u8, x1.?, x2.?));4939 assert(std.mem.eql(u8, x1.?, x2.?));
49404940
4941 var y: ?[]const f32 = [2]f32{ 1.2, 3.4 };4941 var y: ?[]const f32 = &[2]f32{ 1.2, 3.4 };
4942 assert(y.?[0] == 1.2);4942 assert(y.?[0] == 1.2);
4943}4943}
49444944
...@@ -4950,7 +4950,7 @@ test "*[N]T to []T" {...@@ -4950,7 +4950,7 @@ test "*[N]T to []T" {
49504950
4951 const buf2 = [2]f32{ 1.2, 3.4 };4951 const buf2 = [2]f32{ 1.2, 3.4 };
4952 const x2: []const f32 = &buf2;4952 const x2: []const f32 = &buf2;
4953 assert(std.mem.eql(f32, x2, [2]f32{ 1.2, 3.4 }));4953 assert(std.mem.eql(f32, x2, &[2]f32{ 1.2, 3.4 }));
4954}4954}
49554955
4956// Single-item pointers to arrays can be coerced to4956// Single-item pointers to arrays can be coerced to
...@@ -5185,7 +5185,7 @@ fn peerTypeTAndOptionalT(c: bool, b: bool) ?usize {...@@ -5185,7 +5185,7 @@ fn peerTypeTAndOptionalT(c: bool, b: bool) ?usize {
5185 return @as(usize, 3);5185 return @as(usize, 3);
5186}5186}
51875187
5188test "peer type resolution: [0]u8 and []const u8" {5188test "peer type resolution: *[0]u8 and []const u8" {
5189 assert(peerTypeEmptyArrayAndSlice(true, "hi").len == 0);5189 assert(peerTypeEmptyArrayAndSlice(true, "hi").len == 0);
5190 assert(peerTypeEmptyArrayAndSlice(false, "hi").len == 1);5190 assert(peerTypeEmptyArrayAndSlice(false, "hi").len == 1);
5191 comptime {5191 comptime {
...@@ -5195,12 +5195,12 @@ test "peer type resolution: [0]u8 and []const u8" {...@@ -5195,12 +5195,12 @@ test "peer type resolution: [0]u8 and []const u8" {
5195}5195}
5196fn peerTypeEmptyArrayAndSlice(a: bool, slice: []const u8) []const u8 {5196fn peerTypeEmptyArrayAndSlice(a: bool, slice: []const u8) []const u8 {
5197 if (a) {5197 if (a) {
5198 return [_]u8{};5198 return &[_]u8{};
5199 }5199 }
52005200
5201 return slice[0..1];5201 return slice[0..1];
5202}5202}
5203test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" {5203test "peer type resolution: *[0]u8, []const u8, and anyerror![]u8" {
5204 {5204 {
5205 var data = "hi".*;5205 var data = "hi".*;
5206 const slice = data[0..];5206 const slice = data[0..];
...@@ -5216,7 +5216,7 @@ test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" {...@@ -5216,7 +5216,7 @@ test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" {
5216}5216}
5217fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 {5217fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 {
5218 if (a) {5218 if (a) {
5219 return [_]u8{};5219 return &[_]u8{};
5220 }5220 }
52215221
5222 return slice[0..1];5222 return slice[0..1];
...@@ -5746,7 +5746,7 @@ test "fibonacci" {...@@ -5746,7 +5746,7 @@ test "fibonacci" {
5746 </p>5746 </p>
5747 {#code_begin|test#}5747 {#code_begin|test#}
5748const first_25_primes = firstNPrimes(25);5748const first_25_primes = firstNPrimes(25);
5749const sum_of_first_25_primes = sum(first_25_primes);5749const sum_of_first_25_primes = sum(&first_25_primes);
57505750
5751fn firstNPrimes(comptime n: usize) [n]i32 {5751fn firstNPrimes(comptime n: usize) [n]i32 {
5752 var prime_list: [n]i32 = undefined;5752 var prime_list: [n]i32 = undefined;
...@@ -6364,7 +6364,7 @@ test "async function await" {...@@ -6364,7 +6364,7 @@ test "async function await" {
6364 resume the_frame;6364 resume the_frame;
6365 seq('i');6365 seq('i');
6366 assert(final_result == 1234);6366 assert(final_result == 1234);
6367 assert(std.mem.eql(u8, seq_points, "abcdefghi"));6367 assert(std.mem.eql(u8, &seq_points, "abcdefghi"));
6368}6368}
6369fn amain() void {6369fn amain() void {
6370 seq('b');6370 seq('b');
...@@ -8014,7 +8014,7 @@ test "vector @splat" {...@@ -8014,7 +8014,7 @@ test "vector @splat" {
8014 const scalar: u32 = 5;8014 const scalar: u32 = 5;
8015 const result = @splat(4, scalar);8015 const result = @splat(4, scalar);
8016 comptime assert(@typeOf(result) == @Vector(4, u32));8016 comptime assert(@typeOf(result) == @Vector(4, u32));
8017 assert(std.mem.eql(u32, @as([4]u32, result), [_]u32{ 5, 5, 5, 5 }));8017 assert(std.mem.eql(u32, &@as([4]u32, result), &[_]u32{ 5, 5, 5, 5 }));
8018}8018}
8019 {#code_end#}8019 {#code_end#}
8020 <p>8020 <p>
...@@ -8948,7 +8948,7 @@ pub fn main() void {...@@ -8948,7 +8948,7 @@ pub fn main() void {
8948 {#code_begin|test_err|unable to convert#}8948 {#code_begin|test_err|unable to convert#}
8949comptime {8949comptime {
8950 var bytes = [5]u8{ 1, 2, 3, 4, 5 };8950 var bytes = [5]u8{ 1, 2, 3, 4, 5 };
8951 var slice = @bytesToSlice(u32, bytes);8951 var slice = @bytesToSlice(u32, bytes[0..]);
8952}8952}
8953 {#code_end#}8953 {#code_end#}
8954 <p>At runtime:</p>8954 <p>At runtime:</p>
...@@ -9760,7 +9760,7 @@ pub fn build(b: *Builder) void {...@@ -9760,7 +9760,7 @@ pub fn build(b: *Builder) void {
9760 const lib = b.addSharedLibrary("mathtest", "mathtest.zig", b.version(1, 0, 0));9760 const lib = b.addSharedLibrary("mathtest", "mathtest.zig", b.version(1, 0, 0));
97619761
9762 const exe = b.addExecutable("test", null);9762 const exe = b.addExecutable("test", null);
9763 exe.addCSourceFile("test.c", [_][]const u8{"-std=c99"});9763 exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});
9764 exe.linkLibrary(lib);9764 exe.linkLibrary(lib);
9765 exe.linkSystemLibrary("c");9765 exe.linkSystemLibrary("c");
97669766
...@@ -9825,7 +9825,7 @@ pub fn build(b: *Builder) void {...@@ -9825,7 +9825,7 @@ pub fn build(b: *Builder) void {
9825 const obj = b.addObject("base64", "base64.zig");9825 const obj = b.addObject("base64", "base64.zig");
98269826
9827 const exe = b.addExecutable("test", null);9827 const exe = b.addExecutable("test", null);
9828 exe.addCSourceFile("test.c", [_][]const u8{"-std=c99"});9828 exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});
9829 exe.addObject(obj);9829 exe.addObject(obj);
9830 exe.linkSystemLibrary("c");9830 exe.linkSystemLibrary("c");
9831 exe.install();9831 exe.install();
src/ir.cpp+1
...@@ -23646,6 +23646,7 @@ static IrInstruction *ir_analyze_instruction_from_bytes(IrAnalyze *ira, IrInstru...@@ -23646,6 +23646,7 @@ static IrInstruction *ir_analyze_instruction_from_bytes(IrAnalyze *ira, IrInstru
23646 }23646 }
2364723647
23648 if (target->value->type->id == ZigTypeIdPointer &&23648 if (target->value->type->id == ZigTypeIdPointer &&
23649 target->value->type->data.pointer.ptr_len == PtrLenSingle &&
23649 target->value->type->data.pointer.child_type->id == ZigTypeIdArray)23650 target->value->type->data.pointer.child_type->id == ZigTypeIdArray)
23650 {23651 {
23651 known_len = target->value->type->data.pointer.child_type->data.array.len;23652 known_len = target->value->type->data.pointer.child_type->data.array.len;