diff --git a/compiler/builtins/src/std.rs b/compiler/builtins/src/std.rs index 8c6e96bbd4..bf8923a58b 100644 --- a/compiler/builtins/src/std.rs +++ b/compiler/builtins/src/std.rs @@ -13,6 +13,16 @@ use roc_types::subs::VarId; use roc_types::types::RecordField; use std::collections::HashMap; +thread_local! { + static STDLIB: StdLib = standard_stdlib(); +} + +pub fn borrow_stdlib() -> &'static StdLib { + let ptr = STDLIB.with(|x| x as *const StdLib); + + unsafe { &*ptr } +} + /// Example: /// /// let_tvars! { a, b, c }