mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
fixes to get rocLovesRust to work
This commit is contained in:
parent
5ab2466872
commit
033618f3f4
4 changed files with 9 additions and 9 deletions
|
@ -3979,8 +3979,8 @@ fn expose_function_to_host_help_c_abi_v2<'a, 'ctx, 'env>(
|
||||||
// In C, this is modelled as a function returning void
|
// In C, this is modelled as a function returning void
|
||||||
(
|
(
|
||||||
¶ms[..],
|
¶ms[..],
|
||||||
// ¶m_types[..param_types.len().saturating_sub(1)],
|
¶m_types[..param_types.len().saturating_sub(1)],
|
||||||
¶m_types[..],
|
// ¶m_types[..],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
_ => (¶ms[..], ¶m_types[..]),
|
_ => (¶ms[..], ¶m_types[..]),
|
||||||
|
|
|
@ -3114,7 +3114,7 @@ fn specialize_external_help<'a>(
|
||||||
let symbol = env.unique_symbol();
|
let symbol = env.unique_symbol();
|
||||||
let lambda_name = LambdaName::no_niche(symbol);
|
let lambda_name = LambdaName::no_niche(symbol);
|
||||||
|
|
||||||
if false {
|
if true {
|
||||||
raw_function_layout = match raw_function_layout {
|
raw_function_layout = match raw_function_layout {
|
||||||
RawFunctionLayout::Function(a, mut lambda_set, _) => {
|
RawFunctionLayout::Function(a, mut lambda_set, _) => {
|
||||||
lambda_set.ret = in_layout;
|
lambda_set.ret = in_layout;
|
||||||
|
|
|
@ -91,7 +91,7 @@ impl Types {
|
||||||
);
|
);
|
||||||
|
|
||||||
for var in variables {
|
for var in variables {
|
||||||
env.lambda_set_ids = dbg!(env.find_lambda_sets(var));
|
env.lambda_set_ids = env.find_lambda_sets(var);
|
||||||
env.add_type(var, &mut types);
|
env.add_type(var, &mut types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1066,7 +1066,7 @@ fn add_type_help<'a>(
|
||||||
};
|
};
|
||||||
|
|
||||||
let id = env.lambda_set_ids.get(closure_var).unwrap();
|
let id = env.lambda_set_ids.get(closure_var).unwrap();
|
||||||
let extern_name = format!("roc__main_{}_caller", id.0);
|
let extern_name = format!("roc__mainForHost_{}_caller", id.0);
|
||||||
|
|
||||||
for arg_var in args {
|
for arg_var in args {
|
||||||
let arg_layout = env
|
let arg_layout = env
|
||||||
|
|
|
@ -104,11 +104,11 @@ pub struct RocFunction_66 {
|
||||||
impl RocFunction_66 {
|
impl RocFunction_66 {
|
||||||
pub fn force_thunk(self, arg_0: ()) -> Op {
|
pub fn force_thunk(self, arg_0: ()) -> Op {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn roc__main_0_caller(output: *mut Op, arg_0: (), closure_data: *mut u8);
|
fn roc__mainForHost_0_caller(output: *mut Op, arg_0: (), closure_data: *mut u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut output = std::mem::MaybeUninit::uninit();
|
let mut output = std::mem::MaybeUninit::uninit();
|
||||||
unsafe { roc__main_0_caller(output.as_mut_ptr(), arg_0, self.closure_data) };
|
unsafe { roc__mainForHost_0_caller(output.as_mut_ptr(), arg_0, self.closure_data) };
|
||||||
unsafe { output.assume_init() }
|
unsafe { output.assume_init() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,11 +129,11 @@ pub struct RocFunction_67 {
|
||||||
impl RocFunction_67 {
|
impl RocFunction_67 {
|
||||||
pub fn force_thunk(self, arg_0: ()) -> Op {
|
pub fn force_thunk(self, arg_0: ()) -> Op {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn roc__main_1_caller(output: *mut Op, arg_0: (), closure_data: *mut u8);
|
fn roc__mainForHost_1_caller(output: *mut Op, arg_0: (), closure_data: *mut u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut output = std::mem::MaybeUninit::uninit();
|
let mut output = std::mem::MaybeUninit::uninit();
|
||||||
unsafe { roc__main_1_caller(output.as_mut_ptr(), arg_0, self.closure_data) };
|
unsafe { roc__mainForHost_1_caller(output.as_mut_ptr(), arg_0, self.closure_data) };
|
||||||
unsafe { output.assume_init() }
|
unsafe { output.assume_init() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue