bevy/crates/bevy_reflect/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
..
enums bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
func bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
impls bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
path Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
serde Update bincode to 2.0 (#18396) 2025-03-25 04:09:46 +00:00
array.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
attributes.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
error.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
fields.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
from_reflect.rs bevy_reflect: Apply #[deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17092) 2025-01-03 22:22:34 +00:00
generics.rs Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
kind.rs Remove Implicit std Prelude from no_std Crates (#17086) 2025-01-03 01:58:43 +00:00
lib.rs bevy_reflect: Fix TypePath string concatenation (#18609) 2025-03-29 21:01:53 +00:00
list.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
map.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
reflect.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
reflectable.rs bevy_reflect: Add Reflectable trait (#5772) 2024-09-18 00:36:41 +00:00
remote.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
set.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
std_traits.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
struct_trait.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
tuple_struct.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
tuple.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
type_info_stack.rs Remove Implicit std Prelude from no_std Crates (#17086) 2025-01-03 01:58:43 +00:00
type_info.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
type_path.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
type_registry.rs Add TypeRegistry::register_by_val (#17817) 2025-02-15 19:07:01 +00:00
utility.rs bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00