diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-06-03 16:02:23 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-06-03 20:21:20 +0300 |
| commit | 6d44c0a16c90a13cb3507751e2015edf51c642cf (patch) | |
| tree | 6dfa9b43c776a3a34fad7aedada8b76b5eac5ac2 /lib/std/meta.zig | |
| parent | 1a7b4ddeaedb81255cfa8907958c3cf09dd340ee (diff) | |
| download | zig-6d44c0a16c90a13cb3507751e2015edf51c642cf.tar.gz zig-6d44c0a16c90a13cb3507751e2015edf51c642cf.zip | |
std: update tests to stage2 semantics
Diffstat (limited to 'lib/std/meta.zig')
| -rw-r--r-- | lib/std/meta.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 0de51bfa68..c6717ad1c0 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -311,7 +311,10 @@ pub fn assumeSentinel(p: anytype, comptime sentinel_val: Elem(@TypeOf(p))) Senti const ReturnType = Sentinel(T, sentinel_val); switch (@typeInfo(T)) { .Pointer => |info| switch (info.size) { - .Slice => return @bitCast(ReturnType, p), + .Slice => if (@import("builtin").zig_backend == .stage1) + return @bitCast(ReturnType, p) + else + return @ptrCast(ReturnType, p), .Many, .One => return @ptrCast(ReturnType, p), .C => {}, }, |
