diff options
| -rw-r--r-- | src/Compilation.zig | 2 | ||||
| -rw-r--r-- | src/Module.zig | 7 | ||||
| -rw-r--r-- | src/Sema.zig | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index e8b2d994f0..7dbfb5068a 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1639,7 +1639,7 @@ pub fn update(self: *Compilation) !void { // Make sure std.zig is inside the import_table. We unconditionally need // it for start.zig. const std_pkg = module.root_pkg.table.get("std").?; - _ = try module.importPkg(module.root_pkg, std_pkg); + _ = try module.importPkg(std_pkg); // Put a work item in for every known source file to detect if // it changed, and, if so, re-compute ZIR and then queue the job diff --git a/src/Module.zig b/src/Module.zig index af3cdeed47..5e94382648 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -2831,7 +2831,7 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl: *Decl) InnerError!void { } pub fn semaPkg(mod: *Module, pkg: *Package) !void { - const file = (try mod.importPkg(mod.root_pkg, pkg)).file; + const file = (try mod.importPkg(pkg)).file; return mod.semaFile(file); } @@ -3130,8 +3130,7 @@ pub const ImportFileResult = struct { is_new: bool, }; -pub fn importPkg(mod: *Module, cur_pkg: *Package, pkg: *Package) !ImportFileResult { - _ = cur_pkg; +pub fn importPkg(mod: *Module, pkg: *Package) !ImportFileResult { const gpa = mod.gpa; // The resolved path is used as the key in the import table, to detect if @@ -3184,7 +3183,7 @@ pub fn importFile( import_string: []const u8, ) !ImportFileResult { if (cur_file.pkg.table.get(import_string)) |pkg| { - return mod.importPkg(cur_file.pkg, pkg); + return mod.importPkg(pkg); } const gpa = mod.gpa; diff --git a/src/Sema.zig b/src/Sema.zig index ce00578142..419a8b3051 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -7556,7 +7556,7 @@ fn getBuiltinType( ) InnerError!Type { const mod = sema.mod; const std_pkg = mod.root_pkg.table.get("std").?; - const std_file = (mod.importPkg(mod.root_pkg, std_pkg) catch unreachable).file; + const std_file = (mod.importPkg(std_pkg) catch unreachable).file; const opt_builtin_inst = try sema.analyzeNamespaceLookup( block, src, |
