diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-28 15:20:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-28 15:20:49 -0700 |
| commit | e6b3eae490e4d0c427034c3530be4ed5a74e2253 (patch) | |
| tree | 7934bd543a744c6f7da7ba9527a7656088d1c3f8 /src/Module.zig | |
| parent | 0fc79d602bf9b3a5c97cfc28b59193b005692cb2 (diff) | |
| parent | ece1d1daf476fdffc69279c686ad1e2101ce6e4d (diff) | |
| download | zig-e6b3eae490e4d0c427034c3530be4ed5a74e2253.tar.gz zig-e6b3eae490e4d0c427034c3530be4ed5a74e2253.zip | |
Merge pull request #11867 from nektro/patch-2
stage2: ensure builtin packages are always available
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index 4576538a35..397134d911 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -4673,6 +4673,15 @@ pub fn importFile( cur_file: *File, import_string: []const u8, ) !ImportFileResult { + if (std.mem.eql(u8, import_string, "std")) { + return mod.importPkg(mod.main_pkg.table.get("std").?); + } + if (std.mem.eql(u8, import_string, "builtin")) { + return mod.importPkg(mod.main_pkg.table.get("builtin").?); + } + if (std.mem.eql(u8, import_string, "root")) { + return mod.importPkg(mod.root_pkg); + } if (cur_file.pkg.table.get(import_string)) |pkg| { return mod.importPkg(pkg); } |
