no_std: add PathBuf abstraction#608
Closed
mparkachov wants to merge 8 commits intomattwparas:masterfrom
Closed
Conversation
mattwparas
reviewed
Feb 5, 2026
| borrow::Cow, | ||
| cell::{Cell, RefCell}, | ||
| collections::{HashMap, HashSet}, | ||
| path::{Path, PathBuf}, |
Owner
There was a problem hiding this comment.
So my only concern with this change is that there are a bunch of public APIs that expect a std PathBuf, so this change would be breaking. In particular in the engine API. I suppose one fix would be to have the std feature just be a type alias for the standard PathBuf as to not break any callers?
Contributor
Author
There was a problem hiding this comment.
I didn't though about this. I've addressed it by making steel::path::PathBuf a type alias to std::path::PathBuf when std is enabled. That removes the breaking change for public APIs (including engine API): callers still see and pass a std::path::PathBuf in std builds.
What changed from the original wrapper approach:
- crate::path::PathBuf is alias under std and a lightweight string-backed type only under no_std.
- removed the extension trait approach call sites now use standard methods (to_path_buf, to_str) so no extra imports
- no_std PathBuf implements std‑like methods (as_path, as_os_str, to_path_buf, to_str, etc.) to keep the call sites consistent.
# Conflicts: # crates/steel-core/Cargo.toml
- Switch crate::path::PathBuf to a std type alias to preserve public API compatibility. - Expand no_std PathBuf with std-equivalent methods (as_path, as_os_str, to_path_buf, to_str, etc.) to keep call sites consistent.
# Conflicts: # crates/steel-core/src/steel_vm/engine.rs
# Conflicts: # crates/steel-core/src/compiler/modules.rs # src/lib.rs
Contributor
Author
|
Merged master and resolved conflicts. |
Contributor
Author
|
no progress |
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.
Summary:
Testing: