diff --git a/crates/compiler/gen_llvm/src/llvm/build.rs b/crates/compiler/gen_llvm/src/llvm/build.rs index 5eb721ab23..26c10ad8dd 100644 --- a/crates/compiler/gen_llvm/src/llvm/build.rs +++ b/crates/compiler/gen_llvm/src/llvm/build.rs @@ -4147,6 +4147,9 @@ pub fn build_procedures<'a, 'ctx, 'env>( let captures_niche = CapturesNiche::no_niche(); for (symbol, top_level) in glue_layouts.getters.iter().copied() { + dbg!(symbol, unsafe { + std::mem::transmute::(symbol) + }); let it = top_level.arguments.iter().copied(); let bytes = roc_alias_analysis::func_name_bytes_help(symbol, it, captures_niche, &top_level.result); @@ -4180,7 +4183,7 @@ pub fn build_procedures<'a, 'ctx, 'env>( getter_fn, top_level.arguments, top_level.result, - getter_name, + dbg!(getter_name), ); } } diff --git a/crates/glue/src/load.rs b/crates/glue/src/load.rs index c4c2d7be48..825d6db812 100644 --- a/crates/glue/src/load.rs +++ b/crates/glue/src/load.rs @@ -190,7 +190,7 @@ pub fn load_types( // the structs and fields. // // Store them as strings, because symbols won't be useful to glue generators! - names.push(name.as_str(&interns).to_string()); + names.push(dbg!(name.as_str(&interns)).to_string()); } glue_procs_by_layout.insert(layout, names.into_bump_slice()); diff --git a/crates/glue/templates/header.rs b/crates/glue/templates/header.rs index 0ea86d433c..22a435144b 100644 --- a/crates/glue/templates/header.rs +++ b/crates/glue/templates/header.rs @@ -16,3 +16,8 @@ #![allow(clippy::redundant_static_lifetimes)] #![allow(clippy::needless_borrow)] #![allow(clippy::clone_on_copy)] + +type Op_StderrWrite = roc_std::RocStr; +type Op_StdoutWrite = roc_std::RocStr; +type TODO_roc_function_69 = roc_std::RocStr; +type TODO_roc_function_70 = roc_std::RocStr; diff --git a/examples/platform-switching/rust-platform/src/lib.rs b/examples/platform-switching/rust-platform/src/lib.rs index 206203241b..5700c3b906 100644 --- a/examples/platform-switching/rust-platform/src/lib.rs +++ b/examples/platform-switching/rust-platform/src/lib.rs @@ -97,6 +97,8 @@ pub unsafe extern "C" fn roc_send_signal(pid: libc::pid_t, sig: libc::c_int) -> pub extern "C" fn rust_main() -> i32 { use glue::discriminant_Op::*; + println!("Let's do things!"); + let op: Op = unsafe { let mut mem = MaybeUninit::uninit(); @@ -105,11 +107,13 @@ pub extern "C" fn rust_main() -> i32 { mem.assume_init() }; - match op.discriminant() { + match dbg!(op.discriminant()) { StdoutWrite => { let output: RocStr = unsafe { op.get_StdoutWrite_0() }; // let _next = unsafe { op.get_StdoutWrite_1() }; + dbg!(&output); + if let Err(e) = std::io::stdout().write_all(output.as_bytes()) { panic!("Writing to stdout failed! {:?}", e); } @@ -125,6 +129,8 @@ pub extern "C" fn rust_main() -> i32 { Done => {} } + println!("Done!"); + // Exit code 0 }