aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-02-17 01:44:08 +0000
committermlugg <mlugg@mlugg.co.uk>2023-02-21 01:59:37 +0000
commit705d2a3c2cd94faf8e16c660b3b342d6fe900e55 (patch)
tree4db97f8c31a2bbd4299418caf609aff219d543a6 /src/Sema.zig
parentdc1f50e505105cabe1ed53951ca612778d6019ee (diff)
downloadzig-705d2a3c2cd94faf8e16c660b3b342d6fe900e55.tar.gz
zig-705d2a3c2cd94faf8e16c660b3b342d6fe900e55.zip
Implement new module CLI
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 41e5fdc20e..65f3587b3f 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -5311,7 +5311,6 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr
}
const c_import_pkg = Package.create(
sema.gpa,
- "c_import", // TODO: should we make this unique?
null,
c_import_res.out_zig_path,
) catch |err| switch (err) {
@@ -11793,8 +11792,9 @@ fn zirImport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.
return sema.fail(block, operand_src, "import of file outside package path: '{s}'", .{operand});
},
error.PackageNotFound => {
- const cur_pkg = block.getFileScope().pkg;
- return sema.fail(block, operand_src, "no package named '{s}' available within package '{s}'", .{ operand, cur_pkg.name });
+ const name = try block.getFileScope().pkg.getName(sema.gpa, mod.*);
+ defer sema.gpa.free(name);
+ return sema.fail(block, operand_src, "no package named '{s}' available within package '{s}'", .{ operand, name });
},
else => {
// TODO: these errors are file system errors; make sure an update() will