From f70bf3665697aadf4c5ae00e4a41950f37695910 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 25 Jan 2025 14:05:21 +0800 Subject: [PATCH] Fix no-std example --- no_std/no_std_test/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/no_std/no_std_test/src/main.rs b/no_std/no_std_test/src/main.rs index 355eb57da..5325dc510 100644 --- a/no_std/no_std_test/src/main.rs +++ b/no_std/no_std_test/src/main.rs @@ -1,8 +1,9 @@ //! This is a bare-bones `no-std` application that evaluates //! a simple expression and uses the result as the return value. +#![no_main] #![no_std] -#![feature(alloc_error_handler, start, core_intrinsics, lang_items, link_cfg)] +#![feature(alloc_error_handler, core_intrinsics, lang_items, link_cfg)] extern crate alloc; extern crate wee_alloc; @@ -18,8 +19,8 @@ extern "C" {} use rhai::{Engine, INT}; -#[start] -fn main(_argc: isize, _argv: *const *const u8) -> isize { +#[no_mangle] +pub extern "C" fn main(_argc: isize, _argv: *const *const u8) -> isize { // Notice that this is a _raw_ engine. // To do anything useful, load a few packages from `rhai::packages`. let engine = Engine::new_raw();