Skip to content

Commit 680892b

Browse files
Merge pull request #363 from rust-embedded/riscv-types
`riscv-types`: use `#[non_exhaustive]` and implement `core::error::Error` for `result::Error`
2 parents 8b0f86f + 94afbae commit 680892b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

riscv-types/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Changed
1111

12+
- Bump MSRV to 1.81 due to `core::error::Error` trait
13+
- Mark `result::Error` as `#[non_exhaustive]` to allow non-breaking new variants
1214
- Update license to `MIT or Apache-2.0`
1315
- Renamed crate to `riscv-types` as per [#351](https://github.com/rust-embedded/riscv/issues/351)
1416

17+
### Added
18+
19+
- Implement `core::error::Error` for `result::Error`
20+
1521
## riscv-pac [v0.2.0] - 2024-10-19
1622

1723
### Added

riscv-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "riscv-types"
33
version = "0.1.0"
44
edition = "2021"
5-
rust-version = "1.60"
5+
rust-version = "1.81"
66
repository = "https://github.com/rust-embedded/riscv"
77
authors = ["The RISC-V Team <[email protected]>"]
88
categories = ["embedded", "hardware-support", "no-std"]

riscv-types/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This project is developed and maintained by the [RISC-V team][team].
1111

1212
## Minimum Supported Rust Version (MSRV)
1313

14-
This crate is guaranteed to compile on stable Rust 1.60 and up. It *might*
14+
This crate is guaranteed to compile on stable Rust 1.81 and up. It *might*
1515
compile with older versions but that may change in any new patch release.
1616

1717
## License

riscv-types/src/result.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub type Result<T> = core::result::Result<T, Error>;
55

66
/// Represents error variants for the library.
77
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8+
#[non_exhaustive]
89
pub enum Error {
910
/// Attempted out-of-bounds access.
1011
IndexOutOfBounds {
@@ -56,3 +57,5 @@ impl fmt::Display for Error {
5657
}
5758
}
5859
}
60+
61+
impl core::error::Error for Error {}

0 commit comments

Comments
 (0)