Skip to content
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

Use stablilized addr_of macro #50

Merged
merged 1 commit into from
Mar 8, 2021
Merged

Use stablilized addr_of macro #50

merged 1 commit into from
Mar 8, 2021

Commits on Mar 8, 2021

  1. Use stablilized addr_of! macro

    Since Rust 1.51.0, support for macro addr_of! has been stabilized[1],
    and this provides a way to get a raw pointer without potential UB in
    some cases.
    
    Memoffset alreadly uses the feature at the pre-stablilized stage (the
    macro was named as raw_const! then). Therefore, switch to use the
    stablilized version (and name) if Rust 1.51.0 and above is used,
    otherwise use the original fallback version, which works in a less
    technically correct way.
    
    [1]: rust-lang/rust#72279
    
    Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
    fbq committed Mar 8, 2021
    Configuration menu
    Copy the full SHA
    49a01c3 View commit details
    Browse the repository at this point in the history