Fix type parameter name conflicts of derive(Bundle) (#4636)
# Objective
This code currently fails to compile with error ``the name `T` is already used for a generic parameter in this item's generic parameters``, because `T` is also used in code generated by `derive(Bundle)`.
```rust
#[derive(Bundle)]
struct MyBundle<T: Component> {
    component: T,
}
```
## Solution
Add double underscores to type parameter names in `derive(Bundle)`.
			
			
This commit is contained in:
		
							parent
							
								
									e49542b026
								
							
						
					
					
						commit
						2c145826a3
					
				| @ -156,9 +156,9 @@ pub fn derive_bundle(input: TokenStream) -> TokenStream { | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             #[allow(unused_variables, unused_mut, non_snake_case)] |             #[allow(unused_variables, unused_mut, non_snake_case)] | ||||||
|             unsafe fn from_components<T, F>(ctx: &mut T, mut func: F) -> Self |             unsafe fn from_components<__T, __F>(ctx: &mut __T, mut func: __F) -> Self | ||||||
|             where |             where | ||||||
|                 F: FnMut(&mut T) -> #ecs_path::ptr::OwningPtr<'_> |                 __F: FnMut(&mut __T) -> #ecs_path::ptr::OwningPtr<'_> | ||||||
|             { |             { | ||||||
|                 Self { |                 Self { | ||||||
|                     #(#field_from_components)* |                     #(#field_from_components)* | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Yutao Yuan
						Yutao Yuan