Sema: allow @ptrCast of slices changing the length

Also, refactor `Sema.ptrCastFull` to not be a horrifying hellscape.
This commit is contained in:
mlugg
2025-02-01 07:37:27 +00:00
committed by Matthew Lugg
parent d6f8200294
commit 5e20e9b449
11 changed files with 601 additions and 130 deletions

View File

@@ -20,6 +20,7 @@ pub const panic = struct {
pub const outOfBounds = no_panic.outOfBounds;
pub const startGreaterThanEnd = no_panic.startGreaterThanEnd;
pub const inactiveUnionField = no_panic.inactiveUnionField;
pub const sliceCastLenRemainder = no_panic.sliceCastLenRemainder;
pub const reachedUnreachable = no_panic.reachedUnreachable;
pub const unwrapNull = no_panic.unwrapNull;
pub const castToNull = no_panic.castToNull;
@@ -66,6 +67,7 @@ pub const panic = struct {
pub const outOfBounds = no_panic.outOfBounds;
pub const startGreaterThanEnd = no_panic.startGreaterThanEnd;
pub const inactiveUnionField = no_panic.inactiveUnionField;
pub const sliceCastLenRemainder = no_panic.sliceCastLenRemainder;
pub const reachedUnreachable = no_panic.reachedUnreachable;
pub const unwrapNull = no_panic.unwrapNull;
pub const castToNull = no_panic.castToNull;
@@ -112,7 +114,7 @@ pub const panic = struct {
pub const outOfBounds = std.debug.no_panic.outOfBounds;
pub const startGreaterThanEnd = std.debug.no_panic.startGreaterThanEnd;
pub const inactiveUnionField = std.debug.no_panic.inactiveUnionField;
pub const messages = std.debug.no_panic.messages;
pub const sliceCastLenRemainder = no_panic.sliceCastLenRemainder;
pub const reachedUnreachable = no_panic.reachedUnreachable;
pub const unwrapNull = no_panic.unwrapNull;
pub const castToNull = no_panic.castToNull;