An example of “Hello World” with raw Rust:
#![feature(no_core,lang_items,start)]
#![no_core]
#![no_std]
#![no_main]
#[lang = "sized"]
pub trait Sized {}
#[lang = "copy"]
pub trait Copy {}
#[no_mangle]
#[start]
pub extern fn _start ()
{
loop {}
}
You can compile it I think with:
rustc +nightly --crate-type bin -C link-arg=-nostartfiles test.rs
In such book you could obviously use core and std but this is as minimal as it can get (almost) ;-)
An example of “Hello World” with raw Rust:
#![feature(no_core,lang_items,start)]
#![no_core]
#![no_std]
#![no_main]
#[lang = "sized"]
pub trait Sized {}
#[lang = "copy"]
pub trait Copy {}
#[no_mangle]
#[start]
pub extern fn _start ()
{
loop {}
}
You can compile it I think with:
rustc +nightly --crate-type bin -C link-arg=-nostartfiles test.rs
In such book you could obviously use core and std but this is as minimal as it can get (almost) ;-)