| ... | @@ -383,7 +383,7 @@ pub const Wip = struct { | ... | @@ -383,7 +383,7 @@ pub const Wip = struct { |
| 383 | }; | 383 | }; |
| 384 | } | 384 | } |
| 385 | | 385 | |
| 386 | pub fn addString(wip: *Wip, s: []const u8) !u32 { | 386 | pub fn addString(wip: *Wip, s: []const u8) Allocator.Error!u32 { |
| 387 | const gpa = wip.gpa; | 387 | const gpa = wip.gpa; |
| 388 | const index: u32 = @intCast(wip.string_bytes.items.len); | 388 | const index: u32 = @intCast(wip.string_bytes.items.len); |
| 389 | try wip.string_bytes.ensureUnusedCapacity(gpa, s.len + 1); | 389 | try wip.string_bytes.ensureUnusedCapacity(gpa, s.len + 1); |
| ... | @@ -392,7 +392,7 @@ pub const Wip = struct { | ... | @@ -392,7 +392,7 @@ pub const Wip = struct { |
| 392 | return index; | 392 | return index; |
| 393 | } | 393 | } |
| 394 | | 394 | |
| 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 { |
| 396 | const gpa = wip.gpa; | 396 | const gpa = wip.gpa; |
| 397 | const index: u32 = @intCast(wip.string_bytes.items.len); | 397 | const index: u32 = @intCast(wip.string_bytes.items.len); |
| 398 | try wip.string_bytes.writer(gpa).print(fmt, args); | 398 | try wip.string_bytes.writer(gpa).print(fmt, args); |
| ... | @@ -400,12 +400,12 @@ pub const Wip = struct { | ... | @@ -400,12 +400,12 @@ pub const Wip = struct { |
| 400 | return index; | 400 | return index; |
| 401 | } | 401 | } |
| 402 | | 402 | |
| 403 | pub fn addRootErrorMessage(wip: *Wip, em: ErrorMessage) !void { | 403 | pub fn addRootErrorMessage(wip: *Wip, em: ErrorMessage) Allocator.Error!void { |
| 404 | try wip.root_list.ensureUnusedCapacity(wip.gpa, 1); | 404 | try wip.root_list.ensureUnusedCapacity(wip.gpa, 1); |
| 405 | wip.root_list.appendAssumeCapacity(try addErrorMessage(wip, em)); | 405 | wip.root_list.appendAssumeCapacity(try addErrorMessage(wip, em)); |
| 406 | } | 406 | } |
| 407 | | 407 | |
| 408 | pub fn addErrorMessage(wip: *Wip, em: ErrorMessage) !MessageIndex { | 408 | pub fn addErrorMessage(wip: *Wip, em: ErrorMessage) Allocator.Error!MessageIndex { |
| 409 | return @enumFromInt(try addExtra(wip, em)); | 409 | return @enumFromInt(try addExtra(wip, em)); |
| 410 | } | 410 | } |
| 411 | | 411 | |
| ... | @@ -413,15 +413,15 @@ pub const Wip = struct { | ... | @@ -413,15 +413,15 @@ pub const Wip = struct { |
| 413 | return @enumFromInt(addExtraAssumeCapacity(wip, em)); | 413 | return @enumFromInt(addExtraAssumeCapacity(wip, em)); |
| 414 | } | 414 | } |
| 415 | | 415 | |
| 416 | pub fn addSourceLocation(wip: *Wip, sl: SourceLocation) !SourceLocationIndex { | 416 | pub fn addSourceLocation(wip: *Wip, sl: SourceLocation) Allocator.Error!SourceLocationIndex { |
| 417 | return @enumFromInt(try addExtra(wip, sl)); | 417 | return @enumFromInt(try addExtra(wip, sl)); |
| 418 | } | 418 | } |
| 419 | | 419 | |
| 420 | pub fn addReferenceTrace(wip: *Wip, rt: ReferenceTrace) !void { | 420 | pub fn addReferenceTrace(wip: *Wip, rt: ReferenceTrace) Allocator.Error!void { |
| 421 | _ = try addExtra(wip, rt); | 421 | _ = try addExtra(wip, rt); |
| 422 | } | 422 | } |
| 423 | | 423 | |
| 424 | pub fn addBundleAsNotes(wip: *Wip, other: ErrorBundle) !void { | 424 | pub fn addBundleAsNotes(wip: *Wip, other: ErrorBundle) Allocator.Error!void { |
| 425 | const gpa = wip.gpa; | 425 | const gpa = wip.gpa; |
| 426 | | 426 | |
| 427 | try wip.string_bytes.ensureUnusedCapacity(gpa, other.string_bytes.len); | 427 | try wip.string_bytes.ensureUnusedCapacity(gpa, other.string_bytes.len); |