Skip to content

Commit

Permalink
Leave private traits' name out of scope
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 25, 2023
1 parent c3838bd commit 6b00235
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions impl/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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;
use thiserror::__private::AsDynError as _;
#body
}
}
Expand Down Expand Up @@ -125,7 +125,7 @@ fn impl_struct(input: Struct) -> TokenStream {
})
};
quote! {
use thiserror::__private::ThiserrorProvide;
use thiserror::__private::ThiserrorProvide as _;
#source_provide
#self_provide
}
Expand Down Expand Up @@ -266,7 +266,7 @@ fn impl_enum(input: Enum) -> TokenStream {
});
Some(quote! {
fn source(&self) -> ::core::option::Option<&(dyn std::error::Error + 'static)> {
use thiserror::__private::AsDynError;
use thiserror::__private::AsDynError as _;
#[allow(deprecated)]
match self {
#(#arms)*
Expand Down Expand Up @@ -316,7 +316,7 @@ fn impl_enum(input: Enum) -> TokenStream {
#source: #varsource,
..
} => {
use thiserror::__private::ThiserrorProvide;
use thiserror::__private::ThiserrorProvide as _;
#source_provide
#self_provide
}
Expand All @@ -340,7 +340,7 @@ fn impl_enum(input: Enum) -> TokenStream {
};
quote! {
#ty::#ident {#backtrace: #varsource, ..} => {
use thiserror::__private::ThiserrorProvide;
use thiserror::__private::ThiserrorProvide as _;
#source_provide
}
}
Expand Down

0 comments on commit 6b00235

Please sign in to comment.