aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-11-30 00:13:07 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-11-30 00:13:07 -0700
commit902df103c6151c257c90de9ba5f29f7f4b9dbea2 (patch)
tree16a522f3c8bbe34b56038d4810bf2487e32e2d85 /src/Module.zig
parent173d56213b60fc570b6ba3922ee1d40bbf0d0e36 (diff)
downloadzig-902df103c6151c257c90de9ba5f29f7f4b9dbea2.tar.gz
zig-902df103c6151c257c90de9ba5f29f7f4b9dbea2.zip
std lib API deprecations for the upcoming 0.9.0 release
See #3811
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 78c05c1183..805d02b650 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -470,7 +470,7 @@ pub const Decl = struct {
pub const DepsTable = std.AutoArrayHashMapUnmanaged(*Decl, void);
pub fn clearName(decl: *Decl, gpa: *Allocator) void {
- gpa.free(mem.spanZ(decl.name));
+ gpa.free(mem.sliceTo(decl.name, 0));
decl.name = undefined;
}
@@ -627,12 +627,12 @@ pub const Decl = struct {
}
pub fn renderFullyQualifiedName(decl: Decl, writer: anytype) !void {
- const unqualified_name = mem.spanZ(decl.name);
+ const unqualified_name = mem.sliceTo(decl.name, 0);
return decl.src_namespace.renderFullyQualifiedName(unqualified_name, writer);
}
pub fn renderFullyQualifiedDebugName(decl: Decl, writer: anytype) !void {
- const unqualified_name = mem.spanZ(decl.name);
+ const unqualified_name = mem.sliceTo(decl.name, 0);
return decl.src_namespace.renderFullyQualifiedDebugName(unqualified_name, writer);
}
@@ -737,7 +737,7 @@ pub const Decl = struct {
decl.scope.sub_file_path,
loc.line + 1,
loc.column + 1,
- mem.spanZ(decl.name),
+ mem.sliceTo(decl.name, 0),
@tagName(decl.analysis),
});
if (decl.has_tv) {
@@ -1342,7 +1342,7 @@ pub const Namespace = struct {
) @TypeOf(writer).Error!void {
if (ns.parent) |parent| {
const decl = ns.getDecl();
- try parent.renderFullyQualifiedName(mem.spanZ(decl.name), writer);
+ try parent.renderFullyQualifiedName(mem.sliceTo(decl.name, 0), writer);
} else {
try ns.file_scope.renderFullyQualifiedName(writer);
}
@@ -1361,7 +1361,7 @@ pub const Namespace = struct {
var separator_char: u8 = '.';
if (ns.parent) |parent| {
const decl = ns.getDecl();
- try parent.renderFullyQualifiedDebugName(mem.spanZ(decl.name), writer);
+ try parent.renderFullyQualifiedDebugName(mem.sliceTo(decl.name, 0), writer);
} else {
try ns.file_scope.renderFullyQualifiedDebugName(writer);
separator_char = ':';
@@ -3432,7 +3432,7 @@ fn semaDecl(mod: *Module, decl: *Decl) !bool {
return sema.fail(&block_scope, export_src, "export of inline function", .{});
}
// The scope needs to have the decl in it.
- const options: std.builtin.ExportOptions = .{ .name = mem.spanZ(decl.name) };
+ const options: std.builtin.ExportOptions = .{ .name = mem.sliceTo(decl.name, 0) };
try sema.analyzeExport(&block_scope, export_src, options, decl);
}
return type_changed or is_inline != prev_is_inline;
@@ -3501,7 +3501,7 @@ fn semaDecl(mod: *Module, decl: *Decl) !bool {
if (decl.is_exported) {
const export_src = src; // TODO point to the export token
// The scope needs to have the decl in it.
- const options: std.builtin.ExportOptions = .{ .name = mem.spanZ(decl.name) };
+ const options: std.builtin.ExportOptions = .{ .name = mem.sliceTo(decl.name, 0) };
try sema.analyzeExport(&block_scope, export_src, options, decl);
}
@@ -4675,7 +4675,7 @@ pub fn processOutdatedAndDeletedDecls(mod: *Module) !void {
// Remove from the namespace it resides in, preserving declaration order.
assert(decl.zir_decl_index != 0);
- _ = decl.src_namespace.decls.orderedRemove(mem.spanZ(decl.name));
+ _ = decl.src_namespace.decls.orderedRemove(mem.sliceTo(decl.name, 0));
try mod.clearDecl(decl, &outdated_decls);
decl.destroy(mod);