Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,9 @@ jobs:
--target thumbv7m-none-eabi
--features async,defmt-03

msrv-1-60:
msrv-1-81:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- run: >
cargo test
-p embedded-hal:1.0.0
-p embedded-hal-bus
-p embedded-hal-nb
-p embedded-io
-p embedded-io-adapters
-p embedded-can

msrv-1-75:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- uses: dtolnay/[email protected]
- run: cargo test --workspace --all-features
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ on crates.io.

## Minimum Supported Rust Version (MSRV)

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

See [here](docs/msrv.md) for details on how the MSRV may be upgraded.
Expand Down
3 changes: 2 additions & 1 deletion embedded-can/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

...
- Added `core::error::Error` implementations for every custom `impl Error`
- Increased MSRV to 1.81 due to `core::error::Error`

## [v0.4.1] - 2022-09-28

Expand Down
2 changes: 1 addition & 1 deletion embedded-can/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "embedded-can"
version = "0.4.1"
edition = "2021"
rust-version = "1.56"
rust-version = "1.81"

description = "HAL traits for Controller Area Network (CAN) devices."
categories = ["embedded", "hardware-support", "no-std"]
Expand Down
2 changes: 2 additions & 0 deletions embedded-can/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ impl Error for ErrorKind {
}
}

impl core::error::Error for ErrorKind {}

impl core::fmt::Display for ErrorKind {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Expand Down
2 changes: 2 additions & 0 deletions embedded-hal-bus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Added the `alloc` feature.
- Added a new `RcDevice` for I2C and SPI, a reference-counting equivalent to `RefCellDevice`.
- Migrated `std` feature-gated `std::error::Error` implementations to `core::error::Error`
- Increased MSRV to 1.81 due to `core::error::Error`

## [v0.2.0] - 2024-04-23

Expand Down
4 changes: 2 additions & 2 deletions embedded-hal-bus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ categories = ["embedded", "hardware-support", "no-std"]
description = "Bus/Device connection mechanisms for embedded-hal, a Hardware Abstraction Layer (HAL) for embedded systems"
documentation = "https://docs.rs/embedded-hal-bus"
edition = "2021"
rust-version = "1.60"
rust-version = "1.81"
keywords = ["hal", "IO"]
license = "MIT OR Apache-2.0"
name = "embedded-hal-bus"
Expand All @@ -15,7 +15,7 @@ repository = "https://github.com/rust-embedded/embedded-hal"
version = "0.2.0"

[features]
# Enable shared bus implementations using `std::sync::Mutex`, and implement `std::error::Error` for `DeviceError`
# Enable shared bus implementations using `std::sync::Mutex`
std = ["alloc"]
# Use `portable-atomic` to enable `atomic-device` on devices without native atomic CAS
#
Expand Down
3 changes: 1 addition & 2 deletions embedded-hal-bus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ provides mechanisms to obtain multiple `I2c` instances out of a single `I2c` ins
that does not natively support atomic CAS. If you enable this, you must also add `portable-atomic` to your crate with
a feature flag such as `unsafe-assume-single-core` or `critical-section` to choose how atomic CAS is implemented.
See <https://docs.rs/portable-atomic/1.7.0/portable_atomic/#optional-features> for more info.
- **`std`**: enable shared bus implementations using `std::sync::Mutex`, and implement
`std::error::Error` for `DeviceError`.
- **`std`**: enable shared bus implementations using `std::sync::Mutex`.

## Minimum Supported Rust Version (MSRV)

Expand Down
3 changes: 1 addition & 2 deletions embedded-hal-bus/src/spi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ impl<BUS: Display, CS: Display> Display for DeviceError<BUS, CS> {
}
}

#[cfg(feature = "std")]
impl<BUS: Debug + Display, CS: Debug + Display> std::error::Error for DeviceError<BUS, CS> {}
impl<BUS: Debug + Display, CS: Debug + Display> core::error::Error for DeviceError<BUS, CS> {}

impl<BUS, CS> Error for DeviceError<BUS, CS>
where
Expand Down
3 changes: 2 additions & 1 deletion embedded-hal-nb/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

No unreleased changes
- Added `core::error::Error` implementations for every custom `impl Error`
- Increased MSRV to 1.81 due to `core::error::Error`

## [v1.0.0] - 2023-12-28

Expand Down
2 changes: 1 addition & 1 deletion embedded-hal-nb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "embedded-hal-nb"
version = "1.0.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.81"

categories = ["embedded", "hardware-support", "no-std"]
description = "Non-blocking Hardware Abstraction Layer (HAL) for embedded systems using the `nb` crate."
Expand Down
2 changes: 2 additions & 0 deletions embedded-hal-nb/src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ impl Error for ErrorKind {
}
}

impl core::error::Error for ErrorKind {}

impl core::fmt::Display for ErrorKind {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
3 changes: 2 additions & 1 deletion embedded-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

No unreleased changes yet.
- Added `core::error::Error` implementations for every custom `impl Error`
- Increased MSRV to 1.81 due to `core::error::Error`

## [v1.0.0] - 2023-12-28

Expand Down
2 changes: 1 addition & 1 deletion embedded-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ categories = ["asynchronous", "embedded", "hardware-support", "no-std"]
description = " A Hardware Abstraction Layer (HAL) for embedded systems "
documentation = "https://docs.rs/embedded-hal"
edition = "2021"
rust-version = "1.60"
rust-version = "1.81"
keywords = ["hal", "IO"]
license = "MIT OR Apache-2.0"
name = "embedded-hal"
Expand Down
2 changes: 2 additions & 0 deletions embedded-hal/src/digital.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ impl Error for ErrorKind {
}
}

impl core::error::Error for ErrorKind {}

impl core::fmt::Display for ErrorKind {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
2 changes: 2 additions & 0 deletions embedded-hal/src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ impl Error for ErrorKind {
}
}

impl core::error::Error for ErrorKind {}

impl core::fmt::Display for ErrorKind {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
2 changes: 2 additions & 0 deletions embedded-hal/src/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ impl Error for ErrorKind {
}
}

impl core::error::Error for ErrorKind {}

impl core::fmt::Display for ErrorKind {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
2 changes: 2 additions & 0 deletions embedded-hal/src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ impl Error for ErrorKind {
}
}

impl core::error::Error for ErrorKind {}

impl core::fmt::Display for ErrorKind {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion embedded-io-async/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This project is developed and maintained by the [HAL team](https://github.com/ru

## Optional Cargo features

- **`std`**: Adds `From` impls to convert to/from `std::io` structs, adds `std::error::Error` impls.
- **`std`**: Adds `From` impls to convert to/from `std::io` structs.
- **`alloc`**: Adds blanket impls for `Box`, adds `Write` impl to `Vec`.
- **`defmt-03`**: Derive `defmt::Format` from `defmt` 0.3 for enums and structs.

Expand Down
6 changes: 6 additions & 0 deletions embedded-io/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

- Added `core::error::Error` implementations for every custom `impl Error`
- Migrated `std` feature-gated `std::error::Error` implementations to `core::error::Error`
- Increased MSRV to 1.81 due to `core::error::Error`

## 0.6.1 - 2023-10-22

- Make `SliceWriteError` publicly available.
Expand Down
2 changes: 1 addition & 1 deletion embedded-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "embedded-io"
version = "0.6.1"
edition = "2021"
rust-version = "1.60"
rust-version = "1.81"
description = "Embedded IO traits"
repository = "https://github.com/rust-embedded/embedded-hal"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion embedded-io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ targets.

## Optional Cargo features

- **`std`**: Adds `From` impls to convert to/from `std::io` structs, adds `std::error::Error` impls.
- **`std`**: Adds `From` impls to convert to/from `std::io` structs.
- **`alloc`**: Adds blanket impls for `Box`, adds `Write` impl to `Vec`.
- **`defmt-03`**: Derive `defmt::Format` from `defmt` 0.3 for enums and structs.

Expand Down
4 changes: 1 addition & 3 deletions embedded-io/src/impls/slice_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ impl core::fmt::Display for SliceWriteError {
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl std::error::Error for SliceWriteError {}
impl core::error::Error for SliceWriteError {}

/// Write is implemented for `&mut [u8]` by copying into the slice, overwriting
/// its data.
Expand Down
16 changes: 10 additions & 6 deletions embedded-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ impl Error for ErrorKind {
}
}

impl core::error::Error for ErrorKind {}

impl fmt::Display for ErrorKind {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self)
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl Error for std::io::Error {
Expand Down Expand Up @@ -255,9 +263,7 @@ impl<E: fmt::Debug> fmt::Display for ReadExactError<E> {
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl<E: fmt::Debug> std::error::Error for ReadExactError<E> {}
impl<E: fmt::Debug> core::error::Error for ReadExactError<E> {}

/// Errors that could be returned by `Write` on `&mut [u8]`.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
Expand Down Expand Up @@ -290,9 +296,7 @@ impl<E: fmt::Debug> fmt::Display for WriteFmtError<E> {
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl<E: fmt::Debug> std::error::Error for WriteFmtError<E> {}
impl<E: fmt::Debug> core::error::Error for WriteFmtError<E> {}

/// Blocking reader.
///
Expand Down