Skip to content

Commit d160dd2

Browse files
authored
Merge pull request #267 from dtolnay/useunderscore
Leave private traits' name out of scope
2 parents c3838bd + 6b00235 commit d160dd2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

impl/src/expand.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fn impl_struct(input: Struct) -> TokenStream {
8989
let source_method = source_body.map(|body| {
9090
quote! {
9191
fn source(&self) -> ::core::option::Option<&(dyn std::error::Error + 'static)> {
92-
use thiserror::__private::AsDynError;
92+
use thiserror::__private::AsDynError as _;
9393
#body
9494
}
9595
}
@@ -125,7 +125,7 @@ fn impl_struct(input: Struct) -> TokenStream {
125125
})
126126
};
127127
quote! {
128-
use thiserror::__private::ThiserrorProvide;
128+
use thiserror::__private::ThiserrorProvide as _;
129129
#source_provide
130130
#self_provide
131131
}
@@ -266,7 +266,7 @@ fn impl_enum(input: Enum) -> TokenStream {
266266
});
267267
Some(quote! {
268268
fn source(&self) -> ::core::option::Option<&(dyn std::error::Error + 'static)> {
269-
use thiserror::__private::AsDynError;
269+
use thiserror::__private::AsDynError as _;
270270
#[allow(deprecated)]
271271
match self {
272272
#(#arms)*
@@ -316,7 +316,7 @@ fn impl_enum(input: Enum) -> TokenStream {
316316
#source: #varsource,
317317
..
318318
} => {
319-
use thiserror::__private::ThiserrorProvide;
319+
use thiserror::__private::ThiserrorProvide as _;
320320
#source_provide
321321
#self_provide
322322
}
@@ -340,7 +340,7 @@ fn impl_enum(input: Enum) -> TokenStream {
340340
};
341341
quote! {
342342
#ty::#ident {#backtrace: #varsource, ..} => {
343-
use thiserror::__private::ThiserrorProvide;
343+
use thiserror::__private::ThiserrorProvide as _;
344344
#source_provide
345345
}
346346
}

0 commit comments

Comments
 (0)