Skip to content

Commit 7dcbfbf

Browse files
committed
stage2: all pointers have runtime bits
1 parent a39c51c commit 7dcbfbf

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

src/type.zig

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,6 +2373,18 @@ pub const Type = extern union {
23732373
.error_union,
23742374
.error_set,
23752375
.error_set_merged,
2376+
.anyframe_T,
2377+
.optional_single_mut_pointer,
2378+
.optional_single_const_pointer,
2379+
.single_const_pointer,
2380+
.single_mut_pointer,
2381+
.many_const_pointer,
2382+
.many_mut_pointer,
2383+
.c_const_pointer,
2384+
.c_mut_pointer,
2385+
.const_slice,
2386+
.mut_slice,
2387+
.pointer,
23762388
=> return true,
23772389

23782390
// These are false because they are comptime-only types.
@@ -2398,30 +2410,6 @@ pub const Type = extern union {
23982410
.fn_ccc_void_no_args,
23992411
=> return false,
24002412

2401-
// These types have more than one possible value, so the result is the same as
2402-
// asking whether they are comptime-only types.
2403-
.anyframe_T,
2404-
.optional_single_mut_pointer,
2405-
.optional_single_const_pointer,
2406-
.single_const_pointer,
2407-
.single_mut_pointer,
2408-
.many_const_pointer,
2409-
.many_mut_pointer,
2410-
.c_const_pointer,
2411-
.c_mut_pointer,
2412-
.const_slice,
2413-
.mut_slice,
2414-
.pointer,
2415-
=> {
2416-
if (ignore_comptime_only) {
2417-
return true;
2418-
} else if (sema_kit) |sk| {
2419-
return !(try sk.sema.typeRequiresComptime(sk.block, sk.src, ty));
2420-
} else {
2421-
return !comptimeOnly(ty);
2422-
}
2423-
},
2424-
24252413
.optional => {
24262414
var buf: Payload.ElemType = undefined;
24272415
const child_ty = ty.optionalChild(&buf);

0 commit comments

Comments
 (0)