ensure that wgpu::Error is Sync (#5820)

* ensure that `wgpu::Error` is `Sync`

This makes it possible to wrap the error in `anyhow::Error` and
`eyre::Report`, which require the inner error to be `Sync`.

* update changelog
This commit is contained in:
Christofer Nolander 2024-06-17 01:48:35 +02:00 committed by GitHub
parent e78c33b309
commit fe31966fdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -134,6 +134,7 @@ By @atlv24 in [#5383](https://github.com/gfx-rs/wgpu/pull/5383)
#### General
- Avoid introducing spurious features for optional dependencies. By @bjorn3 in [#5691](https://github.com/gfx-rs/wgpu/pull/5691)
- `wgpu::Error` is now `Sync`, making it possible to be wrapped in `anyhow::Error` or `eyre::Report`. By @nolanderc in [#5820](https://github.com/gfx-rs/wgpu/pull/5820)
#### Metal
- Removed the `link` Cargo feature.

View File

@ -5873,7 +5873,7 @@ pub enum Error {
/// Lower level source of the error.
#[cfg(send_sync)]
#[cfg_attr(docsrs, doc(cfg(all())))]
source: Box<dyn error::Error + Send + 'static>,
source: Box<dyn error::Error + Send + Sync + 'static>,
/// Lower level source of the error.
#[cfg(not(send_sync))]
#[cfg_attr(docsrs, doc(cfg(all())))]
@ -5884,7 +5884,7 @@ pub enum Error {
/// Lower level source of the error.
#[cfg(send_sync)]
#[cfg_attr(docsrs, doc(cfg(all())))]
source: Box<dyn error::Error + Send + 'static>,
source: Box<dyn error::Error + Send + Sync + 'static>,
/// Lower level source of the error.
#[cfg(not(send_sync))]
#[cfg_attr(docsrs, doc(cfg(all())))]
@ -5899,7 +5899,7 @@ pub enum Error {
/// Lower level source of the error.
#[cfg(send_sync)]
#[cfg_attr(docsrs, doc(cfg(all())))]
source: Box<dyn error::Error + Send + 'static>,
source: Box<dyn error::Error + Send + Sync + 'static>,
/// Lower level source of the error.
#[cfg(not(send_sync))]
#[cfg_attr(docsrs, doc(cfg(all())))]
@ -5909,7 +5909,7 @@ pub enum Error {
},
}
#[cfg(send_sync)]
static_assertions::assert_impl_all!(Error: Send);
static_assertions::assert_impl_all!(Error: Send, Sync);
impl error::Error for Error {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {