diff --git a/ast/Cargo.toml b/ast/Cargo.toml index f59262ae..23ec53ab 100644 --- a/ast/Cargo.toml +++ b/ast/Cargo.toml @@ -12,11 +12,11 @@ ordered-float = { version = "4.2.0", default-features = false } thiserror = { version = "1.0.59", optional = true } TSPL = { version = "0.0.12", optional = true } -hvm64-util = { path = "../util", default-features = false } +hvm64-util = { path = "../util" } [features] default = ["std", "parser"] -std = ["hvm64-util/std", "ordered-float/std", "dep:thiserror"] +std = ["ordered-float/std", "dep:thiserror"] parser = ["dep:TSPL"] [lints] diff --git a/host/Cargo.toml b/host/Cargo.toml index 2aebbca7..a043de2b 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" path = "src/host.rs" [dependencies] +hvm64-util = { path = "../util" } hvm64-ast = { path = "../ast", default-features = false } -hvm64-util = { path = "../util", default-features = false } hvm64-runtime = { path = "../runtime", default-features = false } [features] -std = ["hvm64-ast/std", "hvm64-util/std", "hvm64-runtime/std"] +std = ["hvm64-ast/std", "hvm64-runtime/std"] [lints] workspace = true diff --git a/prelude.rs b/prelude.rs index cf38a55a..0ae61b05 100644 --- a/prelude.rs +++ b/prelude.rs @@ -2,7 +2,6 @@ extern crate alloc; #[allow(unused)] mod prelude { - pub use alloc::{ borrow::ToOwned, boxed::Box, diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c8cc6661..d111f892 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -7,11 +7,10 @@ edition = "2021" path = "src/runtime.rs" [dependencies] -hvm64-util = { path = "../util", default-features = false } +hvm64-util = { path = "../util" } [features] -default = ["std"] -std = ["hvm64-util/std"] +std = [] trace = ["std"] [lints] diff --git a/util/Cargo.toml b/util/Cargo.toml index 0d5fabea..4c17b160 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -4,11 +4,7 @@ version = "0.3.0" edition = "2021" [dependencies] -arrayvec = { version = "0.7.4", default-features = false } stacker = { version = "0.1.15", default-features = false } -[features] -std = ["arrayvec/std"] - [lints] workspace = true diff --git a/util/src/array_vec.rs b/util/src/array_vec.rs deleted file mode 100644 index 3e2c6b32..00000000 --- a/util/src/array_vec.rs +++ /dev/null @@ -1,29 +0,0 @@ -use arrayvec::ArrayVec; - -struct Assert; - -trait IsTrue {} - -impl IsTrue for Assert {} - -#[allow(private_bounds)] -pub fn from_array(array: [T; LEN]) -> ArrayVec -where - Assert<{ LEN <= CAP }>: IsTrue, -{ - let mut vec = ArrayVec::new(); - unsafe { - for el in array { - vec.push_unchecked(el) - } - } - vec -} - -pub fn from_iter(iter: impl IntoIterator) -> ArrayVec { - let mut vec = ArrayVec::new(); - for item in iter { - vec.push(item); - } - vec -} diff --git a/util/src/lib.rs b/util/src/lib.rs index 5f066894..cd78d26d 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -1,10 +1,7 @@ -#![cfg_attr(not(feature = "std"), no_std)] -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] +#![no_std] include!("../../prelude.rs"); -pub mod array_vec; pub mod bi_enum; pub mod create_var; pub mod deref; @@ -13,7 +10,6 @@ pub mod ops; pub mod parse_abbrev_number; pub mod pretty_num; -pub use array_vec::*; pub use create_var::*; pub use maybe_grow::*; pub use parse_abbrev_number::*;