File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 208208 clippy:: return_self_not_must_use,
209209 clippy:: wildcard_imports,
210210) ]
211+ #![ cfg_attr( provide_any, feature( provide_any) ) ]
211212
212213mod aserror;
213214mod display;
215+ #[ cfg( provide_any) ]
216+ mod provide;
214217
215218pub use thiserror_impl:: * ;
216219
@@ -219,4 +222,6 @@ pub use thiserror_impl::*;
219222pub mod __private {
220223 pub use crate :: aserror:: AsDynError ;
221224 pub use crate :: display:: { DisplayAsDisplay , PathAsDisplay } ;
225+ #[ cfg( provide_any) ]
226+ pub use crate :: provide:: ThiserrorProvide ;
222227}
Original file line number Diff line number Diff line change 1+ use std:: any:: { Demand , Provider } ;
2+
3+ pub trait ThiserrorProvide : Sealed {
4+ fn thiserror_provide < ' a > ( & ' a self , demand : & mut Demand < ' a > ) ;
5+ }
6+
7+ impl < T : Provider + ?Sized > ThiserrorProvide for T {
8+ #[ inline]
9+ fn thiserror_provide < ' a > ( & ' a self , demand : & mut Demand < ' a > ) {
10+ self . provide ( demand) ;
11+ }
12+ }
13+
14+ pub trait Sealed { }
15+ impl < T : Provider + ?Sized > Sealed for T { }
You can’t perform that action at this time.
0 commit comments