From 12aea925748acc50973e0f66b4b438a25cd37c99 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Wed, 25 Feb 2026 11:41:25 +0800 Subject: [PATCH 1/2] Revert "Workaround rustfmt panic on `quote!(Self(#var))` in Rust 1.93.0 (#22669)" This reverts commit 304265be5be20970668b202891f203f37172c88e. The root cause for the rustfmt panic was fixed in which was included in the Rust 1.93.1 point release. --- crates/bevy_reflect/derive/src/from_reflect.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/bevy_reflect/derive/src/from_reflect.rs b/crates/bevy_reflect/derive/src/from_reflect.rs index bb920c13edb2f..7ba645b28a11a 100644 --- a/crates/bevy_reflect/derive/src/from_reflect.rs +++ b/crates/bevy_reflect/derive/src/from_reflect.rs @@ -146,11 +146,6 @@ fn impl_struct_internal( // The constructed "Self" ident let __this = Ident::new("__this", Span::call_site()); - // Workaround for rustfmt issue: https://github.com/rust-lang/rustfmt/issues/6779 - // `quote!(Self(#__this))` causes rustfmt to panic in Rust 1.93.0+ - // TODO: not needed after Rust 1.94 - let self_ty = quote!(Self); - // The reflected type: either `Self` or a remote type let (reflect_ty, constructor, retval) = if let Some(remote_ty) = remote_ty { let constructor = match remote_ty.as_expr_path() { @@ -162,10 +157,10 @@ fn impl_struct_internal( ( quote!(#remote_ty), quote!(#constructor), - quote!(#self_ty(#__this)), + quote!(Self(#__this)), ) } else { - (quote!(#self_ty), quote!(#self_ty), quote!(#__this)) + (quote!(Self), quote!(Self), quote!(#__this)) }; let constructor = if is_defaultable { From b13651398d504e83711515d8d1de1982b0b9ac36 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Mon, 8 Jun 2026 09:14:21 +0800 Subject: [PATCH 2/2] Bump `bevy_reflect` MSRV to 1.95.0 --- crates/bevy_reflect/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_reflect/Cargo.toml b/crates/bevy_reflect/Cargo.toml index f3a0f56ae3b2c..546af8b70a810 100644 --- a/crates/bevy_reflect/Cargo.toml +++ b/crates/bevy_reflect/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://bevy.org" repository = "https://github.com/bevyengine/bevy" license = "MIT OR Apache-2.0" keywords = ["bevy"] -rust-version = "1.87.0" +rust-version = "1.95.0" [features] default = ["std", "smallvec", "indexmap", "debug", "auto_register_inventory"]