langref: embrace the term "illegal behavior"

Also standardise the terms "safety-checked" and "unchecked".
This commit is contained in:
mlugg
2025-02-01 16:47:26 +00:00
parent def7e2f20a
commit f0b331e95a
3 changed files with 66 additions and 50 deletions

View File

@@ -2,7 +2,7 @@ test "@setRuntimeSafety" {
// The builtin applies to the scope that it is called in. So here, integer overflow
// will not be caught in ReleaseFast and ReleaseSmall modes:
// var x: u8 = 255;
// x += 1; // undefined behavior in ReleaseFast/ReleaseSmall modes.
// x += 1; // Unchecked Illegal Behavior in ReleaseFast/ReleaseSmall modes.
{
// However this block has safety enabled, so safety checks happen here,
// even in ReleaseFast and ReleaseSmall modes.
@@ -15,7 +15,7 @@ test "@setRuntimeSafety" {
// would not be caught in any build mode.
@setRuntimeSafety(false);
// var x: u8 = 255;
// x += 1; // undefined behavior in all build modes.
// x += 1; // Unchecked Illegal Behavior in all build modes.
}
}
}