Soften Requirement on std Since Error Moved from std to core#726
Merged
InsertCreativityHere merged 1 commit intoicerpc:mainfrom Feb 6, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the codebase to take advantage of the core::error::Error trait that was stabilized in Rust 1.81, removing the previous requirement on the std feature for error handling. The changes replace references to std::error::Error with core::error::Error and change feature gates from std to alloc where appropriate.
Changes:
- Replaced all references to
std::error::Errorwithcore::error::Error - Changed feature gates from
stdtoallocfor error source tracking functionality - Simplified conditional compilation in buffer handling code
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| slice-codec/src/error.rs | Updated Error type to use core::error::Error instead of std::error::Error, changed feature gates from std to alloc for source error tracking |
| slice-codec/src/buffer/vec.rs | Removed conditional compilation that distinguished between std and non-std error handling, now consistently uses new_with_source |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
externl
approved these changes
Feb 6, 2026
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.
For context, Rust has 2 "levels" of standard library:
core: the 'true' standard library which is always available no matter what.std: a superset which includes extra things only available on non-embedded systemsThe
slice-codechas a "feature flag" namedstdwhich is enabled by default, but if it's disabled, our crate supports being used withoutstd: on embedded systems.Rust has a general
trait Error, which all error like types should implement.But, for years, this trait was
std::error::Error: only available if you were usingstd.In Rust 1.81 (released 1.5 years ago) they moved it to
core::error::Error, so now it's part ofcore.This PR implements #716: we remove this feature gate where it is no longer necessary.