core: Replace std with core and alloc, where possible (but on v0.6)#412
core: Replace std with core and alloc, where possible (but on v0.6)#412keks wants to merge 1 commit intopdeljanov:dev-0.6from
Conversation
|
This is good progress! I've bumped the MSRV to 1.85 (Rust 2024 edition) since 0.6 has taken much longer than expected to get out the door. Please make sure to run rustfmt with the nightly toolchain ( I won't be committing to no_std in 0.6, but if there are internal-only changes that get us closer I may take those if all the changes look straightforward enough. Regardless, please feel free to continue pushing no_std forward in this PR branch as it is a popular request and I support the idea even if the majority will need to be pushed to a 0.7. |
2391369 to
12354d5
Compare
12354d5 to
8301d26
Compare
|
Sounds good! I switched to core::error, formatted and rebased. For the hashmap it looks like the best way would be to use the hashbrown crate - my understanding is that this is the same as Getting rid of |
This is the same as #411. I rebuilt that on dev-0.6 when I realized that you are not working on master.
This tries to pick up where #358 left off, in an effort towards #88. This PR only does obvious things that are easy to review. I will try to look at the others later.
The remaining uses of std are:
std::collections::HashMap. Unfortunately this is not yet in alloc, and I am not sure when it will be. See Move HashMap to liballoc rust-lang/rust#27242std::ioandstd::fsfor obvious reasons.Moved tostd::error. Whileerror_in_corewas stabilized in 1.81.0, it looks like the Rust version given in the Cargo.toml is older than that, so I left it for now.core::errorafter MSRV was updated to 1.85.