From ffc14e7c29fce963f0180fcc656db7ac9a0ea5a6 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 23 Oct 2020 21:55:20 +0000 Subject: [PATCH] . --- lib/bind/rust/src/lib.rs | 4 ++-- lib/rt/src/rtcalls.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bind/rust/src/lib.rs b/lib/bind/rust/src/lib.rs index 623f35a..738573e 100644 --- a/lib/bind/rust/src/lib.rs +++ b/lib/bind/rust/src/lib.rs @@ -12,11 +12,11 @@ pub fn abort(msg: &str) -> ! { rt::chtk_abort(buf.as_ptr()); } -pub struct Context; +pub struct Context(*mut rt::Context); impl Context { fn get() -> Context { - panic!() + rt } } diff --git a/lib/rt/src/rtcalls.rs b/lib/rt/src/rtcalls.rs index de42af8..1273710 100644 --- a/lib/rt/src/rtcalls.rs +++ b/lib/rt/src/rtcalls.rs @@ -11,7 +11,7 @@ pub type c_char = i8; pub struct Context; #[no_mangle] -pub extern fn chtk_malloc(bytes: usize) -> *mut u8 { +pub extern unsafe fn chtk_malloc(bytes: usize) -> *mut u8 { panic!() }