Skip to content

Commit 378d3e4

Browse files
authored
Solve the return type ambiguity (#1628)
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}
1 parent 822d4fa commit 378d3e4

File tree

201 files changed

+90349
-90323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+90349
-90323
lines changed

build.zig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn build(b: *Builder) !void {
1717

1818
const rel_zig_exe = try os.path.relative(b.allocator, b.build_root, b.zig_exe);
1919
const langref_out_path = os.path.join(b.allocator, b.cache_root, "langref.html") catch unreachable;
20-
var docgen_cmd = b.addCommand(null, b.env_map, [][]const u8{
20+
var docgen_cmd = b.addCommand(null, b.env_map, [][]const u8.{
2121
docgen_exe.getOutputPath(),
2222
rel_zig_exe,
2323
"doc" ++ os.path.sep_str ++ "langref.html.in",
@@ -31,12 +31,12 @@ pub fn build(b: *Builder) !void {
3131
const test_step = b.step("test", "Run all the tests");
3232

3333
// find the stage0 build artifacts because we're going to re-use config.h and zig_cpp library
34-
const build_info = try b.exec([][]const u8{
34+
const build_info = try b.exec([][]const u8.{
3535
b.zig_exe,
3636
"BUILD_INFO",
3737
});
3838
var index: usize = 0;
39-
var ctx = Context{
39+
var ctx = Context.{
4040
.cmake_binary_dir = nextValue(&index, build_info),
4141
.cxx_compiler = nextValue(&index, build_info),
4242
.llvm_config_exe = nextValue(&index, build_info),
@@ -141,29 +141,29 @@ fn addCppLib(b: *Builder, lib_exe_obj: var, cmake_binary_dir: []const u8, lib_na
141141
lib_exe_obj.addObjectFile(os.path.join(b.allocator, cmake_binary_dir, "zig_cpp", b.fmt("{}{}{}", lib_prefix, lib_name, lib_exe_obj.target.libFileExt())) catch unreachable);
142142
}
143143

144-
const LibraryDep = struct {
144+
const LibraryDep = struct.{
145145
libdirs: ArrayList([]const u8),
146146
libs: ArrayList([]const u8),
147147
system_libs: ArrayList([]const u8),
148148
includes: ArrayList([]const u8),
149149
};
150150

151151
fn findLLVM(b: *Builder, llvm_config_exe: []const u8) !LibraryDep {
152-
const libs_output = try b.exec([][]const u8{
152+
const libs_output = try b.exec([][]const u8.{
153153
llvm_config_exe,
154154
"--libs",
155155
"--system-libs",
156156
});
157-
const includes_output = try b.exec([][]const u8{
157+
const includes_output = try b.exec([][]const u8.{
158158
llvm_config_exe,
159159
"--includedir",
160160
});
161-
const libdir_output = try b.exec([][]const u8{
161+
const libdir_output = try b.exec([][]const u8.{
162162
llvm_config_exe,
163163
"--libdir",
164164
});
165165

166-
var result = LibraryDep{
166+
var result = LibraryDep.{
167167
.libs = ArrayList([]const u8).init(b.allocator),
168168
.system_libs = ArrayList([]const u8).init(b.allocator),
169169
.includes = ArrayList([]const u8).init(b.allocator),
@@ -268,7 +268,7 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
268268
dependOnLib(exe, ctx.llvm);
269269

270270
if (exe.target.getOs() == builtin.Os.linux) {
271-
const libstdcxx_path_padded = try b.exec([][]const u8{
271+
const libstdcxx_path_padded = try b.exec([][]const u8.{
272272
ctx.cxx_compiler,
273273
"-print-file-name=libstdc++.a",
274274
});
@@ -298,7 +298,7 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
298298
exe.linkSystemLibrary("c");
299299
}
300300

301-
const Context = struct {
301+
const Context = struct.{
302302
cmake_binary_dir: []const u8,
303303
cxx_compiler: []const u8,
304304
llvm_config_exe: []const u8,

0 commit comments

Comments
 (0)