Suppress unused_qualifications lint

This commit is contained in:
David Tolnay 2020-06-15 16:09:22 -07:00
parent 3a80d0325a
commit d0ece37338
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -113,6 +113,7 @@ fn impl_struct(input: Struct) -> TokenStream {
};
let display_impl = display_body.map(|body| {
quote! {
#[allow(unused_qualifications)]
impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause {
#[allow(clippy::used_underscore_binding)]
fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
@ -127,6 +128,7 @@ fn impl_struct(input: Struct) -> TokenStream {
let from = from_field.ty;
let body = from_initializer(from_field, backtrace_field);
quote! {
#[allow(unused_qualifications)]
impl #impl_generics std::convert::From<#from> for #ty #ty_generics #where_clause {
#[allow(deprecated)]
fn from(source: #from) -> Self {
@ -139,6 +141,7 @@ fn impl_struct(input: Struct) -> TokenStream {
let error_trait = spanned_error_trait(input.original);
quote! {
#[allow(unused_qualifications)]
impl #impl_generics #error_trait for #ty #ty_generics #where_clause {
#source_method
#backtrace_method
@ -294,6 +297,7 @@ fn impl_enum(input: Enum) -> TokenStream {
}
});
Some(quote! {
#[allow(unused_qualifications)]
impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause {
fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
#use_as_display
@ -315,6 +319,7 @@ fn impl_enum(input: Enum) -> TokenStream {
let from = from_field.ty;
let body = from_initializer(from_field, backtrace_field);
Some(quote! {
#[allow(unused_qualifications)]
impl #impl_generics std::convert::From<#from> for #ty #ty_generics #where_clause {
#[allow(deprecated)]
fn from(source: #from) -> Self {
@ -327,6 +332,7 @@ fn impl_enum(input: Enum) -> TokenStream {
let error_trait = spanned_error_trait(input.original);
quote! {
#[allow(unused_qualifications)]
impl #impl_generics #error_trait for #ty #ty_generics #where_clause {
#source_method
#backtrace_method