bevy/crates/bevy_reflect/derive/src
Gino Valente 39745eb069 bevy_reflect: Fix TypePath string concatenation (#18609)
# Objective

Fixes #18606

When a type implements `Add` for `String`, the compiler can get confused
when attempting to add a `&String` to a `String`.

Unfortunately, this seems to be [expected
behavior](https://github.com/rust-lang/rust/issues/77143#issuecomment-698369286)
which causes problems for generic types since the current `TypePath`
derive generates code that appends strings in this manner.

## Solution

Explicitly use the `Add<&str>` implementation in the `TypePath` derive
macro.

## Testing

You can test locally by running:

```
cargo check -p bevy_reflect --tests
```
2025-03-30 10:21:19 +02:00
..
impls bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
attribute_parser.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
container_attributes.rs Address Lints in bevy_reflect (#18479) 2025-03-25 22:40:33 +01:00
custom_attributes.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
derive_data.rs Address Lints in bevy_reflect (#18479) 2025-03-25 22:40:33 +01:00
documentation.rs Rename bevy_reflect_derive folder to derive (#13269) 2024-05-07 07:55:32 +00:00
enum_utility.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
field_attributes.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
from_reflect.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
generics.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
ident.rs split bevy_reflect::derive::utilities into proper modules (#15354) 2024-09-22 14:24:14 +00:00
lib.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
meta.rs Use one BevyManifest instance in proc macros (#16766) 2024-12-15 15:00:05 +00:00
reflect_opaque.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
registration.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
remote.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
result_sifter.rs split bevy_reflect::derive::utilities into proper modules (#15354) 2024-09-22 14:24:14 +00:00
serialization.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
string_expr.rs bevy_reflect: Fix TypePath string concatenation (#18609) 2025-03-30 10:21:19 +02:00
struct_utility.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
trait_reflection.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
type_path.rs Rename bevy_reflect_derive folder to derive (#13269) 2024-05-07 07:55:32 +00:00
where_clause_options.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00