Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions impl/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fn fallback(input: &DeriveInput, error: syn::Error) -> TokenStream {
#error

#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics std::error::Error for #ty #ty_generics #where_clause
where
// Work around trivial bounds being unstable.
Expand All @@ -44,6 +45,7 @@ fn fallback(input: &DeriveInput, error: syn::Error) -> TokenStream {
{}

#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics ::core::fmt::Display for #ty #ty_generics #where_clause {
fn fmt(&self, __formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::unreachable!()
Expand Down Expand Up @@ -178,6 +180,7 @@ fn impl_struct(input: Struct) -> TokenStream {
let display_where_clause = display_inferred_bounds.augment_where_clause(input.generics);
quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics ::core::fmt::Display for #ty #ty_generics #display_where_clause {
#[allow(clippy::used_underscore_binding)]
fn fmt(&self, __formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
Expand All @@ -193,6 +196,7 @@ fn impl_struct(input: Struct) -> TokenStream {
let body = from_initializer(from_field, backtrace_field);
quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics ::core::convert::From<#from> for #ty #ty_generics #where_clause {
#[allow(deprecated)]
fn from(source: #from) -> Self {
Expand All @@ -211,6 +215,7 @@ fn impl_struct(input: Struct) -> TokenStream {

quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics std::error::Error for #ty #ty_generics #error_where_clause {
#source_method
#provide_method
Expand Down Expand Up @@ -427,6 +432,7 @@ fn impl_enum(input: Enum) -> TokenStream {
let display_where_clause = display_inferred_bounds.augment_where_clause(input.generics);
Some(quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics ::core::fmt::Display for #ty #ty_generics #display_where_clause {
fn fmt(&self, __formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
#use_as_display
Expand All @@ -449,6 +455,7 @@ fn impl_enum(input: Enum) -> TokenStream {
let body = from_initializer(from_field, backtrace_field);
Some(quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics ::core::convert::From<#from> for #ty #ty_generics #where_clause {
#[allow(deprecated)]
fn from(source: #from) -> Self {
Expand All @@ -467,6 +474,7 @@ fn impl_enum(input: Enum) -> TokenStream {

quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics std::error::Error for #ty #ty_generics #error_where_clause {
#source_method
#provide_method
Expand Down