From f81b9b9c9d3d88a87adfb5ec581617b6588f9365 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 18 Jul 2025 20:07:04 -0700 Subject: [PATCH] Delete #[automatically_derived] on impl blocks that are not trait impls Rustc nightly-2025-07-19 has begun warning about this. warning: `#[automatically_derived]` only has an effect on trait implementation blocks --> demo/src/main.rs:23:12 | 23 | fn put(&self, parts: &mut MultiBuf) -> u64; | ^^^ | = note: `#[warn(unused_attributes)]` on by default warning: `#[automatically_derived]` only has an effect on trait implementation blocks --> demo/src/main.rs:24:12 | 24 | fn tag(&self, blobid: u64, tag: &str); | ^^^ warning: `#[automatically_derived]` only has an effect on trait implementation blocks --> demo/src/main.rs:25:12 | 25 | fn metadata(&self, blobid: u64) -> BlobMetadata; | ^^^^^^^^ --- macro/src/expand.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/macro/src/expand.rs b/macro/src/expand.rs index 5ed8d8280..712d0bf3e 100644 --- a/macro/src/expand.rs +++ b/macro/src/expand.rs @@ -360,7 +360,6 @@ fn expand_enum(enm: &Enum) -> TokenStream { #[repr(transparent)] #enum_def - #[automatically_derived] #[allow(non_upper_case_globals)] impl #ident { #(#variants)* @@ -777,7 +776,6 @@ fn expand_cxx_function_shim(efn: &ExternFn, types: &Types) -> TokenStream { &elided_generics }; quote_spanned! {ident.span()=> - #[automatically_derived] impl #generics #receiver_ident #receiver_generics { #doc #attrs