mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 16:51:53 +03:00
Use alignCast over intToPtr
This commit is contained in:
parent
284ff5de35
commit
077c37d9fb
@ -79,9 +79,7 @@ pub const RocList = extern struct {
|
||||
}
|
||||
|
||||
pub fn elements(self: RocList, comptime T: type) ?[*]T {
|
||||
// Is there a better way to make this cast happen?
|
||||
// @ptrCast gives an error because this increases alignment.
|
||||
return @intToPtr(?[*]T, @ptrToInt(self.bytes));
|
||||
return @ptrCast(?[*]T, @alignCast(@alignOf(T), self.bytes));
|
||||
}
|
||||
|
||||
pub fn isUnique(self: RocList) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user