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 into
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 |
|
Hey @pdeljanov, I am interested in this as well.
Considering these changes essentially only replace std with core, what is keeping you from merging them? I don't think the changes would even affect any user of the library. Is there anything anybody could do to help you with this? Ignoring this MR is holding up efforts towards no_std that would build on this first step, and I know you have expressed interest in no_std support in the past. |
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.