mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-06 22:37:38 +03:00
Perform imports from thiserror through absolute path
This commit is contained in:
parent
184c10078e
commit
fa2ba3a531
1 changed files with 6 additions and 6 deletions
|
@ -91,7 +91,7 @@ fn impl_struct(input: Struct) -> TokenStream {
|
|||
let source_method = source_body.map(|body| {
|
||||
quote! {
|
||||
fn source(&self) -> ::core::option::Option<&(dyn std::error::Error + 'static)> {
|
||||
use thiserror::__private::AsDynError as _;
|
||||
use ::thiserror::__private::AsDynError as _;
|
||||
#body
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ fn impl_struct(input: Struct) -> TokenStream {
|
|||
})
|
||||
};
|
||||
quote! {
|
||||
use thiserror::__private::ThiserrorProvide as _;
|
||||
use ::thiserror::__private::ThiserrorProvide as _;
|
||||
#source_provide
|
||||
#self_provide
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ fn impl_enum(input: Enum) -> TokenStream {
|
|||
});
|
||||
Some(quote! {
|
||||
fn source(&self) -> ::core::option::Option<&(dyn std::error::Error + 'static)> {
|
||||
use thiserror::__private::AsDynError as _;
|
||||
use ::thiserror::__private::AsDynError as _;
|
||||
#[allow(deprecated)]
|
||||
match self {
|
||||
#(#arms)*
|
||||
|
@ -323,7 +323,7 @@ fn impl_enum(input: Enum) -> TokenStream {
|
|||
#source: #varsource,
|
||||
..
|
||||
} => {
|
||||
use thiserror::__private::ThiserrorProvide as _;
|
||||
use ::thiserror::__private::ThiserrorProvide as _;
|
||||
#source_provide
|
||||
#self_provide
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ fn impl_enum(input: Enum) -> TokenStream {
|
|||
};
|
||||
quote! {
|
||||
#ty::#ident {#backtrace: #varsource, ..} => {
|
||||
use thiserror::__private::ThiserrorProvide as _;
|
||||
use ::thiserror::__private::ThiserrorProvide as _;
|
||||
#source_provide
|
||||
}
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ fn fields_pat(fields: &[Field]) -> TokenStream {
|
|||
fn use_as_display(needs_as_display: bool) -> Option<TokenStream> {
|
||||
if needs_as_display {
|
||||
Some(quote! {
|
||||
use thiserror::__private::AsDisplay as _;
|
||||
use ::thiserror::__private::AsDisplay as _;
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue