mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Use alignCast over intToPtr
This commit is contained in:
parent
284ff5de35
commit
077c37d9fb
1 changed files with 1 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue