| ... | ... | @@ -1349,15 +1349,6 @@ pub fn boolMask(comptime MaskInt: type, value: bool) callconv(.Inline) MaskInt { |
| 1349 | 1349 | return @bitCast(i1, @as(u1, @boolToInt(value))); |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | | // At comptime, -% is disallowed on unsigned values. |
| 1353 | | // So we need to jump through some hoops in that case. |
| 1354 | | // This is a workaround for #7951 |
| 1355 | | if (@typeInfo(@TypeOf(.{value})).Struct.fields[0].is_comptime) { |
| 1356 | | // Since it's comptime, we don't need this to generate nice code. |
| 1357 | | // We can just do a branch here. |
| 1358 | | return if (value) ~@as(MaskInt, 0) else 0; |
| 1359 | | } |
| 1360 | | |
| 1361 | 1352 | return -%@intCast(MaskInt, @boolToInt(value)); |
| 1362 | 1353 | } |
| 1363 | 1354 | |