riscovite/
lib.rs

1#![no_std]
2#![feature(try_trait_v2)]
3#![allow(internal_features)]
4#![feature(lang_items)]
5#![feature(rustc_attrs)]
6#![feature(core_io_borrowed_buf)]
7#![cfg_attr(not(feature = "rustc-dep-of-std"), feature(new_zeroed_alloc))]
8#![allow(unexpected_cfgs)] // to avoid complaints about target_os = "riscovite"
9
10#[cfg(not(target_arch = "riscv64"))]
11compile_error!("riscovite crate is only compatible with riscv64 targets");
12
13#[cfg(not(any(target_os = "riscovite", target_os = "none")))]
14compile_error!("riscovite crate is only compatible with riscovite or bare-metal targets");
15
16#[cfg(all(feature = "rt", feature = "std"))]
17compile_error!("cannot enable both \"rt\" and \"std\" features together");
18#[cfg(all(feature = "rustc-dep-of-std", feature = "std"))]
19compile_error!("cannot enable both \"rustc-dep-of-std\" and \"std\" features together");
20
21#[cfg(not(feature = "rustc-dep-of-std"))]
22extern crate alloc;
23
24#[cfg(feature = "std")]
25extern crate std;
26
27#[cfg(not(feature = "rustc-dep-of-std"))]
28pub mod fs;
29#[cfg(not(feature = "rustc-dep-of-std"))]
30pub mod io;
31#[cfg(not(feature = "rustc-dep-of-std"))]
32pub mod object;
33#[cfg(not(feature = "rustc-dep-of-std"))]
34pub mod task;
35
36// Only "sys" is available when we're a dependency of Rust std.
37pub mod sys;
38
39#[cfg(feature = "rt")]
40mod rt;