Gilnaa / memoffset

offsetof for Rust
MIT License
224 stars 29 forks source link

Remove const_transmute feature dependency #45

Closed RSSchermer closed 4 years ago

RSSchermer commented 4 years ago

const_transmute seems to have been stabilized on current nightly, see https://github.com/rust-lang/rust/pull/72920. This caused an unrecognized feature flag error when compiling against nightly.

RalfJung commented 4 years ago

The feature flag will still be needed when using offset_of! in a const fn, though. That should be documented at least.

RSSchermer commented 4 years ago

Ah, I hadn't noticed yet that the flag essentially got replaced with const_fn_transmute. I added a test case for offset_of! inside a const fn that seemed to indicate the const_fn feature flag is also requirement. I've added a line to the readme.

RalfJung commented 4 years ago

This is great, thanks. :) Can you run rustfmt on it so that CI passes?

RSSchermer commented 4 years ago

Ah, sorry, silly oversight.