| ... | ... | @@ -20841,9 +20841,9 @@ fn validateExternType( |
| 20841 | 20841 | .Opaque, |
| 20842 | 20842 | .Bool, |
| 20843 | 20843 | .Float, |
| 20844 | | .Pointer, |
| 20845 | 20844 | .AnyFrame, |
| 20846 | 20845 | => return true, |
| 20846 | .Pointer => return !ty.isSlice(), |
| 20847 | 20847 | .Int => switch (ty.intInfo(sema.mod.getTarget()).bits) { |
| 20848 | 20848 | 8, 16, 32, 64, 128 => return true, |
| 20849 | 20849 | else => return false, |
| ... | ... | @@ -20886,7 +20886,6 @@ fn explainWhyTypeIsNotExtern( |
| 20886 | 20886 | .Opaque, |
| 20887 | 20887 | .Bool, |
| 20888 | 20888 | .Float, |
| 20889 | | .Pointer, |
| 20890 | 20889 | .AnyFrame, |
| 20891 | 20890 | => return, |
| 20892 | 20891 | |
| ... | ... | @@ -20902,6 +20901,7 @@ fn explainWhyTypeIsNotExtern( |
| 20902 | 20901 | .Frame, |
| 20903 | 20902 | => return, |
| 20904 | 20903 | |
| 20904 | .Pointer => try mod.errNoteNonLazy(src_loc, msg, "slices have no guaranteed in-memory representation", .{}), |
| 20905 | 20905 | .Void => try mod.errNoteNonLazy(src_loc, msg, "'void' is a zero bit type; for C 'void' use 'anyopaque'", .{}), |
| 20906 | 20906 | .NoReturn => try mod.errNoteNonLazy(src_loc, msg, "'noreturn' is only allowed as a return type", .{}), |
| 20907 | 20907 | .Int => if (ty.intInfo(sema.mod.getTarget()).bits > 128) { |
| ... | ... | @@ -20960,11 +20960,11 @@ fn validatePackedType(ty: Type) bool { |
| 20960 | 20960 | .Void, |
| 20961 | 20961 | .Bool, |
| 20962 | 20962 | .Float, |
| 20963 | | .Pointer, |
| 20964 | 20963 | .Int, |
| 20965 | 20964 | .Vector, |
| 20966 | 20965 | .Enum, |
| 20967 | 20966 | => return true, |
| 20967 | .Pointer => return !ty.isSlice(), |
| 20968 | 20968 | .Struct, .Union => return ty.containerLayout() == .Packed, |
| 20969 | 20969 | } |
| 20970 | 20970 | } |
| ... | ... | @@ -20980,7 +20980,6 @@ fn explainWhyTypeIsNotPacked( |
| 20980 | 20980 | .Void, |
| 20981 | 20981 | .Bool, |
| 20982 | 20982 | .Float, |
| 20983 | | .Pointer, |
| 20984 | 20983 | .Int, |
| 20985 | 20984 | .Vector, |
| 20986 | 20985 | .Enum, |
| ... | ... | @@ -21001,6 +21000,7 @@ fn explainWhyTypeIsNotPacked( |
| 21001 | 21000 | .Optional, |
| 21002 | 21001 | .Array, |
| 21003 | 21002 | => try mod.errNoteNonLazy(src_loc, msg, "type has no guaranteed in-memory representation", .{}), |
| 21003 | .Pointer => try mod.errNoteNonLazy(src_loc, msg, "slices have no guaranteed in-memory representation", .{}), |
| 21004 | 21004 | .Fn => { |
| 21005 | 21005 | try mod.errNoteNonLazy(src_loc, msg, "type has no guaranteed in-memory representation", .{}); |
| 21006 | 21006 | try mod.errNoteNonLazy(src_loc, msg, "use '*const ' to make a function pointer type", .{}); |