Commit Graph

13 Commits

Author SHA1 Message Date
Gilad Naaman 726aae7d3a Automatically enable const evaluation
When running on a compiler newer than 1.65,
automatically enable usage of the macro in const contexts.

Closes https://github.com/Gilnaa/memoffset/issues/4
2022-12-11 21:53:36 +02:00
Boqun Feng 8c9b3eddcf Use stablilized addr_of! macro (#50)
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]: https://github.com/rust-lang/rust/pull/72279

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
2021-03-08 19:56:59 +01:00
Andrew Gaspar 7dc779f328 Support tuples in offset_of (#48)
Support tuple types via new offset_of_tuple / raw_field_tuple macros
2020-10-23 09:16:25 +02:00
Gilad Naaman 2d89f26516 Fixed build for 1.19 2020-03-16 19:23:25 +02:00
Gilad Naaman c150ad4941 Switch to autocfg from rustc_version 2020-03-16 19:07:13 +02:00
Ralf Jung 9f13984808 allow clippy lint only on recent enough compilers 2019-11-17 20:47:03 +01:00
Ralf Jung f8fbd6d073 remove redundant namespacing from some features 2019-11-17 20:45:27 +01:00
Gilad Naaman b17540333a Fixed build for old nightlies where doctests were not present. 2019-11-07 18:43:17 +02:00
Ralf Jung 207a08c623 fmt 2019-08-10 11:59:57 +02:00
Ralf Jung b7e2959e55 test README only on nightly, so that it can be a dev-dependency 2019-08-10 11:43:04 +02:00
Gilad Naaman 9e67d272b3 Fixed MaybeUninit for 1.36 2019-07-04 19:33:22 +03:00
Gilad Naaman d0bc87f11a Fixed soundness issues and removed nested member access. 2019-07-02 20:56:30 +03:00
Gilad Naaman 9174130890 Added dual support for 1.33 and 1.19 2019-03-15 11:38:46 +02:00