Skip to content

Commit c5ba941

Browse files
committed
stage2: all pointers have runtime bits
1 parent 7d674d5 commit c5ba941

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

src/type.zig

+12-24
Original file line numberDiff line numberDiff line change
@@ -2374,6 +2374,18 @@ pub const Type = extern union {
23742374
.error_union,
23752375
.error_set,
23762376
.error_set_merged,
2377+
.anyframe_T,
2378+
.optional_single_mut_pointer,
2379+
.optional_single_const_pointer,
2380+
.single_const_pointer,
2381+
.single_mut_pointer,
2382+
.many_const_pointer,
2383+
.many_mut_pointer,
2384+
.c_const_pointer,
2385+
.c_mut_pointer,
2386+
.const_slice,
2387+
.mut_slice,
2388+
.pointer,
23772389
=> return true,
23782390

23792391
// These are false because they are comptime-only types.
@@ -2399,30 +2411,6 @@ pub const Type = extern union {
23992411
.fn_ccc_void_no_args,
24002412
=> return false,
24012413

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

0 commit comments

Comments
 (0)