diff --git a/src/data/master.zig b/src/data/master.zig index dcbc991..0fda360 100644 --- a/src/data/master.zig +++ b/src/data/master.zig @@ -208,7 +208,7 @@ pub const builtins = [_]Builtin{ .signature = "@breakpoint()", .snippet = "@breakpoint()", .documentation = - \\This function inserts a platform-specific debug trap instruction which causes debuggers to break there. + \\This function inserts a platform-specific debug trap instruction which causes debuggers to break there. Unlike for `@trap()`, execution may continue after this point if the program is resumed. \\ \\This function is only valid within function scope. , @@ -1861,6 +1861,17 @@ pub const builtins = [_]Builtin{ , .arguments = &.{}, }, + .{ + .name = "@trap", + .signature = "@trap() noreturn", + .snippet = "@trap()", + .documentation = + \\This function inserts a platform-specific trap/jam instruction which can be used to exit the program abnormally. This may be implemented by explicitly emitting an invalid instruction which may cause an illegal instruction exception of some sort. Unlike for `@breakpoint()`, execution does not continue after this point. + \\ + \\Outside function scope, this builtin causes a compile error. + , + .arguments = &.{}, + }, .{ .name = "@truncate", .signature = "@truncate(comptime T: type, integer: anytype) T",