miden_thiserror/
provide.rs

1#[cfg(all(not(feature = "std"), error_in_core))]
2use core::error::{Error, Request};
3#[cfg(feature = "std")]
4use std::error::{Error, Request};
5#[cfg(not(any(feature = "std", error_in_core)))]
6compile_error!("cannot compile this feature without the 'std' feature or a nightly compiler");
7
8#[doc(hidden)]
9pub trait ThiserrorProvide: Sealed {
10    fn thiserror_provide<'a>(&'a self, request: &mut Request<'a>);
11}
12
13impl<T> ThiserrorProvide for T
14where
15    T: Error + ?Sized,
16{
17    #[inline]
18    fn thiserror_provide<'a>(&'a self, request: &mut Request<'a>) {
19        self.provide(request);
20    }
21}
22
23#[doc(hidden)]
24pub trait Sealed {}
25impl<T: Error + ?Sized> Sealed for T {}