Skip to content

Soften Requirement on std Since Error Moved from std to core#726

Merged
InsertCreativityHere merged 1 commit intoicerpc:mainfrom
InsertCreativityHere:remove-error-feature-gate
Feb 6, 2026
Merged

Soften Requirement on std Since Error Moved from std to core#726
InsertCreativityHere merged 1 commit intoicerpc:mainfrom
InsertCreativityHere:remove-error-feature-gate

Conversation

@InsertCreativityHere
Copy link
Member

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 systems

The slice-codec has a "feature flag" named std which is enabled by default, but if it's disabled, our crate supports being used without std: 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 using std.
In Rust 1.81 (released 1.5 years ago) they moved it to core::error::Error, so now it's part of core.

This PR implements #716: we remove this feature gate where it is no longer necessary.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::Error with core::error::Error
  • Changed feature gates from std to alloc for 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.

@InsertCreativityHere InsertCreativityHere merged commit 92d0e0c into icerpc:main Feb 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants