More precise alignCast (allow for 32-bit targets)

This commit is contained in:
Brian Carroll 2021-12-13 16:09:55 +00:00
parent 457041a314
commit 3c74acafa4
4 changed files with 7 additions and 7 deletions

View file

@ -247,7 +247,7 @@ pub const RocResult = extern struct {
// - the tag is the first field
// - the tag is usize bytes wide
// - Ok has tag_id 1, because Err < Ok
const usizes: [*]usize = @ptrCast([*]usize, @alignCast(8, self.bytes));
const usizes: [*]usize = @ptrCast([*]usize, @alignCast(@alignOf(usize), self.bytes));
return usizes[0] == 1;
}