Skip to content

Commit

Permalink
add in manually drop
Browse files Browse the repository at this point in the history
  • Loading branch information
bhansconnect committed Dec 14, 2024
1 parent ccbb5cd commit e55fcef
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader, Read, Write};
use std::mem::ManuallyDrop;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Mutex, OnceLock};

Expand All @@ -20,7 +21,7 @@ fn file_handles() -> &'static Mutex<HashMap<u64, BufReader<File>>> {

extern "C" {
#[link_name = "roc__mainForHost_1_exposed"]
fn roc_main(args: RocStr);
fn roc_main(args: ManuallyDrop<RocStr>);
}

#[no_mangle]
Expand Down Expand Up @@ -103,7 +104,7 @@ pub extern "C" fn rust_main() -> i32 {
.expect("Please pass a .false file as a command-line argument to the false interpreter!");
let arg = RocStr::from(arg.as_str());

unsafe { roc_main(arg) };
unsafe { roc_main(ManuallyDrop::new(arg)) };

// Exit code
0
Expand Down

0 comments on commit e55fcef

Please sign in to comment.