-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Make proc macros hygienic in bevy_reflect_derive #6752
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one non-blocking comment
crates/bevy_reflect/bevy_reflect_derive/src/container_attributes.rs
Outdated
Show resolved
Hide resolved
bors try |
tryBuild failed: |
@@ -0,0 +1,45 @@ | |||
use proc_macro2::TokenStream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Not super necessary but it would be nice to either have a module-level doc here stating the purpose of these FQ***
types or doc comments on the individual structs (or both haha).
It's pretty simple/self-explanatory so definitely not required, but I like to make sure the barrier to contributing is low for newcomers :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the doc too.
use proc_macro2::TokenStream; | ||
use quote::{quote, ToTokens}; | ||
|
||
// This module contains unit structs that should be used inside `quote!` and `spanned_quote!` using the variable interpolation syntax in place of their equivalent structs and traits present in `std`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally module doc comments are made using //!
at the very top of the file (above imports). If we include these, could we move them to the top to be consistent with that format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved them to the top and used //!
for the docs.
Initially, I had thought that using //!
would make this module visible in the user-facing documentation of Bevy but later realized that won't happen.
Blocking on moving the module comment, then I'll merge. |
bors r+ |
# Objective - Fixes #3004 ## Solution - Replaced all the types with their fully quallified names - Replaced all trait methods and inherent methods on dyn traits with their fully qualified names - Made a new file `fq_std.rs` that contains structs corresponding to commonly used Structs and Traits from `std`. These structs are replaced by their respective fully qualified names when used inside `quote!`
Pull request successfully merged into main. Build succeeded:
|
# Objective - Fixes bevyengine#3004 ## Solution - Replaced all the types with their fully quallified names - Replaced all trait methods and inherent methods on dyn traits with their fully qualified names - Made a new file `fq_std.rs` that contains structs corresponding to commonly used Structs and Traits from `std`. These structs are replaced by their respective fully qualified names when used inside `quote!`
# Objective - Fixes bevyengine#3004 ## Solution - Replaced all the types with their fully quallified names - Replaced all trait methods and inherent methods on dyn traits with their fully qualified names - Made a new file `fq_std.rs` that contains structs corresponding to commonly used Structs and Traits from `std`. These structs are replaced by their respective fully qualified names when used inside `quote!`
# Objective - Fixes bevyengine#3004 ## Solution - Replaced all the types with their fully quallified names - Replaced all trait methods and inherent methods on dyn traits with their fully qualified names - Made a new file `fq_std.rs` that contains structs corresponding to commonly used Structs and Traits from `std`. These structs are replaced by their respective fully qualified names when used inside `quote!`
Objective
Solution
fq_std.rs
that contains structs corresponding to commonly used Structs and Traits fromstd
. These structs are replaced by their respective fully qualified names when used insidequote!