Conversation
|
Thanks for the PR! I'm afraid this won't work, as CI shows, since the crate has to keep working with older versions of rustc. We'll have to do something similar to |
|
@RalfJung Thanks. I saw the problem and was struggling to find a solution. Your suggestion is very helpful, Let me look into it and send an updated version. |
README.md
Outdated
| `memoffset` can make use of that feature to avoid what is technically Undefined Behavior. | ||
| Use the `unstable_raw` feature to enable this. | ||
| Since Rust 1.51.0, [a way to create raw pointers](https://github.com/rust-lang/rust/issues/73394) that avoids creating intermediate safe references | ||
| has been stablilized, now `memoffset` makes use of that feature to avoid what is technically Undefined Behavior. |
There was a problem hiding this comment.
I think you can just remove this part of the readme; this is an internal cfg flag now.
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 <[email protected]>
|
Awesome, thanks a lot. :) |
|
@Gilnaa might be a good idea to make a new release with this MR when Rust 1.51 comes out. :) |
|
Sure :) |
|
Filed an issue for it: #51 |
Since Rust 1.51.0, support for macro addr_of!() has been stabilized1,
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) and remove the out-dated version, also
remove the related feature gate.
Signed-off-by: Boqun Feng [email protected]