mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Use fully-qualified type names in proc macro. (#3544)
Modifies the code emitted by `derive_label` to use fully-qualified type names (e.g. `std::boxed::Box` instead of `Box`). # Objective - Using unqualified types here causes errors when the proc macro is used in contexts that locally define types with conflicting names (e.g. a local definition of `Box`). ## Solution - Fully qualify standard types emitted by the proc macro code.
This commit is contained in:
parent
3bb50443d4
commit
1a2646ecc4
1 changed files with 2 additions and 2 deletions
|
@ -86,8 +86,8 @@ pub fn derive_label(input: syn::DeriveInput, trait_path: syn::Path) -> TokenStre
|
|||
|
||||
(quote! {
|
||||
impl #impl_generics #trait_path for #ident #ty_generics #where_clause {
|
||||
fn dyn_clone(&self) -> Box<dyn #trait_path> {
|
||||
Box::new(Clone::clone(self))
|
||||
fn dyn_clone(&self) -> std::boxed::Box<dyn #trait_path> {
|
||||
std::boxed::Box::new(std::clone::Clone::clone(self))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue