File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2374,6 +2374,10 @@ pub const Type = extern union {
23742374 .error_union ,
23752375 .error_set ,
23762376 .error_set_merged ,
2377+ = > return true ,
2378+
2379+ // Pointers to zero-bit types still have a runtime address; however, pointers
2380+ // to comptime-only types do not, with the exception of function pointers.
23772381 .anyframe_T ,
23782382 .optional_single_mut_pointer ,
23792383 .optional_single_const_pointer ,
@@ -2386,7 +2390,17 @@ pub const Type = extern union {
23862390 .const_slice ,
23872391 .mut_slice ,
23882392 .pointer ,
2389- = > return true ,
2393+ = > {
2394+ if (ignore_comptime_only ) {
2395+ return true ;
2396+ } else if (ty .childType ().zigTypeTag () == .Fn ) {
2397+ return true ;
2398+ } else if (sema_kit ) | sk | {
2399+ return ! (try sk .sema .typeRequiresComptime (sk .block , sk .src , ty ));
2400+ } else {
2401+ return ! comptimeOnly (ty );
2402+ }
2403+ },
23902404
23912405 // These are false because they are comptime-only types.
23922406 .single_const_pointer_to_comptime_int ,
You can’t perform that action at this time.
0 commit comments