bevy/crates/bevy_reflect/derive/src
Gino Valente f4716034fa
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-29 21:01:53 +00:00
..
impls bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
attribute_parser.rs
container_attributes.rs Address Lints in bevy_reflect (#18479) 2025-03-23 23:53:31 +00:00
custom_attributes.rs
derive_data.rs Address Lints in bevy_reflect (#18479) 2025-03-23 23:53:31 +00:00
documentation.rs
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
generics.rs
ident.rs
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
registration.rs
remote.rs
result_sifter.rs
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-29 21:01:53 +00: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
where_clause_options.rs