mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Add extra commentabout unsafe usage
This commit is contained in:
parent
d9d0d0c0af
commit
ad974dd473
1 changed files with 1 additions and 0 deletions
|
@ -261,6 +261,7 @@ where
|
||||||
let layout_map = self.layout_map();
|
let layout_map = self.layout_map();
|
||||||
for arg in *arguments {
|
for arg in *arguments {
|
||||||
if let Some(layout) = layout_map.get(arg) {
|
if let Some(layout) = layout_map.get(arg) {
|
||||||
|
// This is safe because every value in the map is always set with a valid layout and cannot be null.
|
||||||
arg_layouts.push(unsafe { *(*layout) });
|
arg_layouts.push(unsafe { *(*layout) });
|
||||||
} else {
|
} else {
|
||||||
return Err(format!("the argument, {:?}, has no know layout", arg));
|
return Err(format!("the argument, {:?}, has no know layout", arg));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue