Merge remote-tracking branch 'origin/trunk' into specialize-lowlevel

This commit is contained in:
Folkert 2021-05-24 15:05:14 +02:00
commit fbb711b2ca
70 changed files with 3513 additions and 126 deletions

View file

@ -1,4 +1,4 @@
#![warn(clippy::all, clippy::dbg_macro)]
#![warn(clippy::dbg_macro)]
// See github.com/rtfeldman/roc/issues/800 for discussion of the large_enum_variant check.
#![allow(clippy::large_enum_variant, clippy::upper_case_acronyms)]

View file

@ -39,6 +39,7 @@ pub enum LowLevel {
ListKeepOks,
ListKeepErrs,
ListSortWith,
ListDrop,
DictSize,
DictEmpty,
DictInsert,
@ -124,6 +125,7 @@ impl LowLevel {
| ListGetUnsafe
| ListSet
| ListSetInPlace
| ListDrop
| ListSingle
| ListRepeat
| ListReverse

View file

@ -86,6 +86,10 @@ impl Symbol {
})
}
pub fn as_u64(self) -> u64 {
self.0
}
pub fn fully_qualified(self, interns: &Interns, home: ModuleId) -> InlinableString {
let module_id = self.module_id();
@ -101,6 +105,10 @@ impl Symbol {
.into()
}
}
pub const fn to_ne_bytes(self) -> [u8; 8] {
self.0.to_ne_bytes()
}
}
/// Rather than displaying as this:
@ -930,6 +938,7 @@ define_builtins! {
29 LIST_WALK_UNTIL: "walkUntil"
30 LIST_RANGE: "range"
31 LIST_SORT_WITH: "sortWith"
32 LIST_DROP: "drop"
}
5 RESULT: "Result" => {
0 RESULT_RESULT: "Result" imported // the Result.Result type alias