We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I think I actually came up with a way to make sysvar implementations fully generic using struct update syntax. Proof:
struct St { x: *mut i32, y: i32 } unsafe impl Sync for St {} trait Foo { const DEFAULT_ST: St = St{x: std::ptr::null_mut(), y: 0}; } struct Bar; impl Foo for Bar {} static TEST: St = St {x: 0x123 as *mut i32, ..Bar::DEFAULT_ST};
The proc macro would create something like TEST. Just needs to detect string literals and convert them to c strings, and keep a map of field mappings.
TEST
To keep safety, 1. this trait needs to be marked unsafe and 2. our proc macro should check and reject raw pointer
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I think I actually came up with a way to make sysvar implementations fully generic using struct update syntax. Proof:
The proc macro would create something like
TEST
. Just needs to detect string literals and convert them to c strings, and keep a map of field mappings.To keep safety, 1. this trait needs to be marked unsafe and 2. our proc macro should check and reject raw pointer
The text was updated successfully, but these errors were encountered: