message-format-compiler: switch to no_std#16
Merged
Conversation
waywardmonkeys
approved these changes
Jun 5, 2026
Contributor
waywardmonkeys
left a comment
There was a problem hiding this comment.
Just fix up to have fewer qualifications and land.
Add `#![no_std]` to the compiler crate with `std` as a default feature.
Gate `CompileError::IoError` behind `#[cfg(feature = "std")]`. Replace
`std::collections` → `alloc::collections`, `std::fmt` → `core::fmt`,
`std::error::Error` → `core::error::Error`, and add explicit `use alloc`
imports throughout. Replace `std::collections::hash_map::DefaultHasher`
with a stored `hashbrown::DefaultHashBuilder` for stable hashing. Use
`libm` for `f64::{ceil,floor,fract}` which are not available in core.
Declare the workspace dependency with `default-features = false` so that
`compile` without `std` actually produces a no_std build. Direct
dependents (resource crates, CLI, LSP, wind_tunnel) opt back in with
`features = ["std"]`.
ec2306f to
05364f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
#![no_std]to the compiler crate withstdas a default feature. GateCompileError::IoErrorbehind#[cfg(feature = "std")]. Replacestd::collections→alloc::collections,std::fmt→core::fmt,std::error::Error→core::error::Error, and add explicituse allocimports throughout. Replacestd::collections::hash_map::DefaultHasherwith a storedhashbrown::DefaultHashBuilderfor stable hashing. Uselibmforf64::{ceil,floor,fract}which are not available in core.Declare the workspace dependency with
default-features = falseso thatcompilewithoutstdactually produces a no_std build. Direct dependents (resource crates, CLI, LSP, wind_tunnel) opt back in withfeatures = ["std"].