Skip to content

Commit 04337eb

Browse files
committed
std.zig.ErrorBundle: add some explicit error sets
1 parent aaaf2c5 commit 04337eb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/std/zig/ErrorBundle.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ pub const Wip = struct {
383383
};
384384
}
385385

386-
pub fn addString(wip: *Wip, s: []const u8) !u32 {
386+
pub fn addString(wip: *Wip, s: []const u8) Allocator.Error!u32 {
387387
const gpa = wip.gpa;
388388
const index: u32 = @intCast(wip.string_bytes.items.len);
389389
try wip.string_bytes.ensureUnusedCapacity(gpa, s.len + 1);
@@ -392,36 +392,36 @@ pub const Wip = struct {
392392
return index;
393393
}
394394

395-
pub fn printString(wip: *Wip, comptime fmt: []const u8, args: anytype) !u32 {
395+
pub fn printString(wip: *Wip, comptime fmt: []const u8, args: anytype) Allocator.Error!u32 {
396396
const gpa = wip.gpa;
397397
const index: u32 = @intCast(wip.string_bytes.items.len);
398398
try wip.string_bytes.writer(gpa).print(fmt, args);
399399
try wip.string_bytes.append(gpa, 0);
400400
return index;
401401
}
402402

403-
pub fn addRootErrorMessage(wip: *Wip, em: ErrorMessage) !void {
403+
pub fn addRootErrorMessage(wip: *Wip, em: ErrorMessage) Allocator.Error!void {
404404
try wip.root_list.ensureUnusedCapacity(wip.gpa, 1);
405405
wip.root_list.appendAssumeCapacity(try addErrorMessage(wip, em));
406406
}
407407

408-
pub fn addErrorMessage(wip: *Wip, em: ErrorMessage) !MessageIndex {
408+
pub fn addErrorMessage(wip: *Wip, em: ErrorMessage) Allocator.Error!MessageIndex {
409409
return @enumFromInt(try addExtra(wip, em));
410410
}
411411

412412
pub fn addErrorMessageAssumeCapacity(wip: *Wip, em: ErrorMessage) MessageIndex {
413413
return @enumFromInt(addExtraAssumeCapacity(wip, em));
414414
}
415415

416-
pub fn addSourceLocation(wip: *Wip, sl: SourceLocation) !SourceLocationIndex {
416+
pub fn addSourceLocation(wip: *Wip, sl: SourceLocation) Allocator.Error!SourceLocationIndex {
417417
return @enumFromInt(try addExtra(wip, sl));
418418
}
419419

420-
pub fn addReferenceTrace(wip: *Wip, rt: ReferenceTrace) !void {
420+
pub fn addReferenceTrace(wip: *Wip, rt: ReferenceTrace) Allocator.Error!void {
421421
_ = try addExtra(wip, rt);
422422
}
423423

424-
pub fn addBundleAsNotes(wip: *Wip, other: ErrorBundle) !void {
424+
pub fn addBundleAsNotes(wip: *Wip, other: ErrorBundle) Allocator.Error!void {
425425
const gpa = wip.gpa;
426426

427427
try wip.string_bytes.ensureUnusedCapacity(gpa, other.string_bytes.len);

0 commit comments

Comments
 (0)