Just use core::mem::offset_of!() on rustc >= 1.77#83
Just use core::mem::offset_of!() on rustc >= 1.77#83RalfJung merged 2 commits intoGilnaa:masterfrom coolreader18:stable_offset_of
Conversation
src/lib.rs
Outdated
| #![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.
IMO we should just remove the unstable feature. It's unstable so not covered by semver / stability.
src/offset_of.rs
Outdated
| #[cfg(any( | ||
| feature = "unstable_const", | ||
| feature = "unstable_offset_of", | ||
| any(feature = "unstable_offset_of", stable_offset_of), |
There was a problem hiding this comment.
Nested any doesn't make a lot of sense, this can be flattened into a single any
There was a problem hiding this comment.
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
| ## 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.
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.
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?