@@ -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
387
const gpa = wip .gpa ;
388
388
const index : u32 = @intCast (wip .string_bytes .items .len );
389
389
try wip .string_bytes .ensureUnusedCapacity (gpa , s .len + 1 );
@@ -392,36 +392,36 @@ pub const Wip = struct {
392
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
396
const gpa = wip .gpa ;
397
397
const index : u32 = @intCast (wip .string_bytes .items .len );
398
398
try wip .string_bytes .writer (gpa ).print (fmt , args );
399
399
try wip .string_bytes .append (gpa , 0 );
400
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
404
try wip .root_list .ensureUnusedCapacity (wip .gpa , 1 );
405
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
409
return @enumFromInt (try addExtra (wip , em ));
410
410
}
411
411
412
412
pub fn addErrorMessageAssumeCapacity (wip : * Wip , em : ErrorMessage ) MessageIndex {
413
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
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
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
425
const gpa = wip .gpa ;
426
426
427
427
try wip .string_bytes .ensureUnusedCapacity (gpa , other .string_bytes .len );
0 commit comments