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 {
2374
2374
.error_union ,
2375
2375
.error_set ,
2376
2376
.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.
2377
2381
.anyframe_T ,
2378
2382
.optional_single_mut_pointer ,
2379
2383
.optional_single_const_pointer ,
@@ -2386,7 +2390,17 @@ pub const Type = extern union {
2386
2390
.const_slice ,
2387
2391
.mut_slice ,
2388
2392
.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
+ },
2390
2404
2391
2405
// These are false because they are comptime-only types.
2392
2406
.single_const_pointer_to_comptime_int ,
You can’t perform that action at this time.
0 commit comments