-
Notifications
You must be signed in to change notification settings - Fork 29
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
Just use core::mem::offset_of!() on rustc >= 1.77 #83
Conversation
src/lib.rs
Outdated
@@ -59,7 +59,10 @@ | |||
feature(const_ptr_offset_from) | |||
)] | |||
#![cfg_attr(feature = "unstable_const", feature(const_refs_to_cell))] | |||
#![cfg_attr(feature = "unstable_offset_of", feature(allow_internal_unstable))] | |||
#![cfg_attr( | |||
all(feature = "unstable_offset_of", not(stable_offset_of)), |
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.
IMO we should just remove the unstable feature. It's unstable so not covered by semver / stability.
src/offset_of.rs
Outdated
@@ -350,7 +382,7 @@ mod tests { | |||
|
|||
#[cfg(any( | |||
feature = "unstable_const", | |||
feature = "unstable_offset_of", | |||
any(feature = "unstable_offset_of", stable_offset_of), |
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.
Nested any
doesn't make a lot of sense, this can be flattened into a single any
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.
Oh, yeah lol. I just did a find/replace.
Thank you! @RalfJung do you think this is a good time to bump the version to 1.0.0? (Hopefully the last one) |
CHANGELOG.md
Outdated
@@ -3,6 +3,8 @@ | |||
## Unreleased | |||
- Clarify documentation about macro indirection | |||
- Added changelog | |||
- Turn the crate into a stdlib polyfill on rustc>=1.77 |
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.
This makes no sense. A polyfill is something that adds missing functionality. If anything this crate is a polyfill on older rustc. :)
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.
Oh, true - I was just reusing the wording from a bit further down.
I'll leave that to @Gilnaa. But I don't see how this crate suddenly would be more stable than before now (in particular the parts outside of |
I was thinking that hopefully this could be released to the 0.9.x and maybe 0.8.x release series, since it makes |
This is already a super light dependency, I don't see the benefits of backporting. But I think this means we should do a 0.9.1 release with this, not a 1.0 release, so that the 0.9 series users get this update. |
This PR looks good, thanks. :) |
Stable
mem::offset_of!()
, yay!I'm unsure about the README changes, maybe those old nightly instructions are just not needed at all anymore?