@@ -35,17 +35,17 @@ fn impl_struct(input: Struct) -> TokenStream {
3535 let source_body = if let Some ( transparent_attr) = & input. attrs . transparent {
3636 let only_field = & input. fields [ 0 ] ;
3737 if only_field. contains_generic {
38- error_inferred_bounds. insert ( only_field. ty , quote ! ( :: thiserror :: __private:: Error ) ) ;
38+ error_inferred_bounds. insert ( only_field. ty , quote ! ( :: wherror :: __private:: Error ) ) ;
3939 }
4040 let member = & only_field. member ;
4141 Some ( quote_spanned ! { transparent_attr. span=>
42- :: thiserror :: __private:: Error :: source( self . #member. as_dyn_error( ) )
42+ :: wherror :: __private:: Error :: source( self . #member. as_dyn_error( ) )
4343 } )
4444 } else if let Some ( source_field) = input. source_field ( ) {
4545 let source = & source_field. member ;
4646 if source_field. contains_generic {
4747 let ty = unoptional_type ( source_field. ty ) ;
48- error_inferred_bounds. insert ( ty, quote ! ( :: thiserror :: __private:: Error + ' static ) ) ;
48+ error_inferred_bounds. insert ( ty, quote ! ( :: wherror :: __private:: Error + ' static ) ) ;
4949 }
5050 let asref = if type_is_option ( source_field. ty ) {
5151 Some ( quote_spanned ! ( source. span( ) => . as_ref( ) ?) )
@@ -63,8 +63,8 @@ fn impl_struct(input: Struct) -> TokenStream {
6363 } ;
6464 let source_method = source_body. map ( |body| {
6565 quote ! {
66- fn source( & self ) -> :: core:: option:: Option <& ( dyn :: thiserror :: __private:: Error + ' static ) > {
67- use :: thiserror :: __private:: AsDynError as _;
66+ fn source( & self ) -> :: core:: option:: Option <& ( dyn :: wherror :: __private:: Error + ' static ) > {
67+ use :: wherror :: __private:: AsDynError as _;
6868 #body
6969 }
7070 }
@@ -91,28 +91,28 @@ fn impl_struct(input: Struct) -> TokenStream {
9191 } else if type_is_option ( backtrace_field. ty ) {
9292 Some ( quote ! {
9393 if let :: core:: option:: Option :: Some ( backtrace) = & self . #backtrace {
94- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( backtrace) ;
94+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( backtrace) ;
9595 }
9696 } )
9797 } else {
9898 Some ( quote ! {
99- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( & self . #backtrace) ;
99+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( & self . #backtrace) ;
100100 } )
101101 } ;
102102 quote ! {
103- use :: thiserror :: __private:: ThiserrorProvide as _;
103+ use :: wherror :: __private:: ThiserrorProvide as _;
104104 #source_provide
105105 #self_provide
106106 }
107107 } else if type_is_option ( backtrace_field. ty ) {
108108 quote ! {
109109 if let :: core:: option:: Option :: Some ( backtrace) = & self . #backtrace {
110- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( backtrace) ;
110+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( backtrace) ;
111111 }
112112 }
113113 } else {
114114 quote ! {
115- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( & self . #backtrace) ;
115+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( & self . #backtrace) ;
116116 }
117117 } ;
118118 quote ! {
@@ -208,7 +208,7 @@ fn impl_struct(input: Struct) -> TokenStream {
208208 quote ! {
209209 #[ allow( unused_qualifications) ]
210210 #[ automatically_derived]
211- impl #impl_generics :: thiserror :: __private:: Error for #ty #ty_generics #error_where_clause {
211+ impl #impl_generics :: wherror :: __private:: Error for #ty #ty_generics #error_where_clause {
212212 #source_method
213213 #provide_method
214214 }
@@ -228,11 +228,11 @@ fn impl_enum(input: Enum) -> TokenStream {
228228 if let Some ( transparent_attr) = & variant. attrs . transparent {
229229 let only_field = & variant. fields [ 0 ] ;
230230 if only_field. contains_generic {
231- error_inferred_bounds. insert ( only_field. ty , quote ! ( :: thiserror :: __private:: Error ) ) ;
231+ error_inferred_bounds. insert ( only_field. ty , quote ! ( :: wherror :: __private:: Error ) ) ;
232232 }
233233 let member = & only_field. member ;
234234 let source = quote_spanned ! { transparent_attr. span=>
235- :: thiserror :: __private:: Error :: source( transparent. as_dyn_error( ) )
235+ :: wherror :: __private:: Error :: source( transparent. as_dyn_error( ) )
236236 } ;
237237 quote ! {
238238 #ty:: #ident { #member: transparent} => #source,
@@ -241,7 +241,7 @@ fn impl_enum(input: Enum) -> TokenStream {
241241 let source = & source_field. member ;
242242 if source_field. contains_generic {
243243 let ty = unoptional_type ( source_field. ty ) ;
244- error_inferred_bounds. insert ( ty, quote ! ( :: thiserror :: __private:: Error + ' static ) ) ;
244+ error_inferred_bounds. insert ( ty, quote ! ( :: wherror :: __private:: Error + ' static ) ) ;
245245 }
246246 let asref = if type_is_option ( source_field. ty ) {
247247 Some ( quote_spanned ! ( source. span( ) => . as_ref( ) ?) )
@@ -262,8 +262,8 @@ fn impl_enum(input: Enum) -> TokenStream {
262262 }
263263 } ) ;
264264 Some ( quote ! {
265- fn source( & self ) -> :: core:: option:: Option <& ( dyn :: thiserror :: __private:: Error + ' static ) > {
266- use :: thiserror :: __private:: AsDynError as _;
265+ fn source( & self ) -> :: core:: option:: Option <& ( dyn :: wherror :: __private:: Error + ' static ) > {
266+ use :: wherror :: __private:: AsDynError as _;
267267 #[ allow( deprecated) ]
268268 match self {
269269 #( #arms) *
@@ -299,12 +299,12 @@ fn impl_enum(input: Enum) -> TokenStream {
299299 let self_provide = if type_is_option ( backtrace_field. ty ) {
300300 quote ! {
301301 if let :: core:: option:: Option :: Some ( backtrace) = backtrace {
302- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( backtrace) ;
302+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( backtrace) ;
303303 }
304304 }
305305 } else {
306306 quote ! {
307- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( backtrace) ;
307+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( backtrace) ;
308308 }
309309 } ;
310310 quote ! {
@@ -313,7 +313,7 @@ fn impl_enum(input: Enum) -> TokenStream {
313313 #source: #varsource,
314314 ..
315315 } => {
316- use :: thiserror :: __private:: ThiserrorProvide as _;
316+ use :: wherror :: __private:: ThiserrorProvide as _;
317317 #source_provide
318318 #self_provide
319319 }
@@ -337,7 +337,7 @@ fn impl_enum(input: Enum) -> TokenStream {
337337 } ;
338338 quote ! {
339339 #ty:: #ident { #backtrace: #varsource, ..} => {
340- use :: thiserror :: __private:: ThiserrorProvide as _;
340+ use :: wherror :: __private:: ThiserrorProvide as _;
341341 #source_provide
342342 }
343343 }
@@ -347,12 +347,12 @@ fn impl_enum(input: Enum) -> TokenStream {
347347 let body = if type_is_option ( backtrace_field. ty ) {
348348 quote ! {
349349 if let :: core:: option:: Option :: Some ( backtrace) = backtrace {
350- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( backtrace) ;
350+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( backtrace) ;
351351 }
352352 }
353353 } else {
354354 quote ! {
355- #request. provide_ref:: <:: thiserror :: __private:: Backtrace >( backtrace) ;
355+ #request. provide_ref:: <:: wherror :: __private:: Backtrace >( backtrace) ;
356356 }
357357 } ;
358358 quote ! {
@@ -486,7 +486,7 @@ fn impl_enum(input: Enum) -> TokenStream {
486486 quote ! {
487487 #[ allow( unused_qualifications) ]
488488 #[ automatically_derived]
489- impl #impl_generics :: thiserror :: __private:: Error for #ty #ty_generics #error_where_clause {
489+ impl #impl_generics :: wherror :: __private:: Error for #ty #ty_generics #error_where_clause {
490490 #source_method
491491 #provide_method
492492 }
@@ -521,7 +521,7 @@ fn fields_pat(fields: &[Field]) -> TokenStream {
521521fn use_as_display ( needs_as_display : bool ) -> Option < TokenStream > {
522522 if needs_as_display {
523523 Some ( quote ! {
524- use :: thiserror :: __private:: AsDisplay as _;
524+ use :: wherror :: __private:: AsDisplay as _;
525525 } )
526526 } else {
527527 None
@@ -544,11 +544,11 @@ fn from_initializer(
544544 let backtrace_member = & backtrace_field. member ;
545545 if type_is_option ( backtrace_field. ty ) {
546546 quote ! {
547- #backtrace_member: :: core:: option:: Option :: Some ( :: thiserror :: __private:: Backtrace :: capture( ) ) ,
547+ #backtrace_member: :: core:: option:: Option :: Some ( :: wherror :: __private:: Backtrace :: capture( ) ) ,
548548 }
549549 } else {
550550 quote ! {
551- #backtrace_member: :: core:: convert:: From :: from( :: thiserror :: __private:: Backtrace :: capture( ) ) ,
551+ #backtrace_member: :: core:: convert:: From :: from( :: wherror :: __private:: Backtrace :: capture( ) ) ,
552552 }
553553 }
554554 } ) ;
0 commit comments