Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into no-std
Browse files Browse the repository at this point in the history
* upstream/master:
  Release 1.0.64
  Mark #[automatically_derived] for generated impls
  • Loading branch information
jordens committed Sep 25, 2024
2 parents 44737a5 + 84484bc commit e779e1b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thiserror"
version = "1.0.63"
version = "1.0.64"
authors = ["David Tolnay <[email protected]>"]
categories = ["rust-patterns"]
description = "derive(Error)"
Expand All @@ -14,7 +14,7 @@ rust-version = "1.56"
# without the `std` feature (i.e. `no_std`): rust-version = "1.81"

[dependencies]
thiserror-impl = { version = "=1.0.63", path = "impl" }
thiserror-impl = { version = "=1.0.64", path = "impl" }

[dev-dependencies]
anyhow = "1.0.73"
Expand Down
2 changes: 1 addition & 1 deletion impl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thiserror-impl"
version = "1.0.63"
version = "1.0.64"
authors = ["David Tolnay <[email protected]>"]
description = "Implementation detail of the `thiserror` crate"
edition = "2021"
Expand Down
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 ::thiserror::__private::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 @@ -180,6 +182,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 @@ -195,6 +198,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 @@ -213,6 +217,7 @@ fn impl_struct(input: Struct) -> TokenStream {

quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics ::thiserror::__private::error::Error for #ty #ty_generics #error_where_clause {
#source_method
#provide_method
Expand Down Expand Up @@ -429,6 +434,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 @@ -451,6 +457,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 @@ -469,6 +476,7 @@ fn impl_enum(input: Enum) -> TokenStream {

quote! {
#[allow(unused_qualifications)]
#[automatically_derived]
impl #impl_generics ::thiserror::__private::error::Error for #ty #ty_generics #error_where_clause {
#source_method
#provide_method
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
//!
//! [`anyhow`]: https://github.com/dtolnay/anyhow
#![doc(html_root_url = "https://docs.rs/thiserror/1.0.63")]
#![doc(html_root_url = "https://docs.rs/thiserror/1.0.64")]
#![allow(
clippy::module_name_repetitions,
clippy::needless_lifetimes,
Expand Down

0 comments on commit e779e1b

Please sign in to comment.