mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
make borrow_stdlib threadsafe
This commit is contained in:
parent
01b810266b
commit
11da96b286
1 changed files with 10 additions and 0 deletions
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue