Commit Graph

13 Commits

Author SHA1 Message Date
Gilad Naaman
923a5f2386 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
576166bb63
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
5f8f5a6b9e
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
4179c58af6 Fixed build for 1.19 2020-03-16 19:23:25 +02:00
Gilad Naaman
449841d45d Switch to autocfg from rustc_version 2020-03-16 19:07:13 +02:00
Ralf Jung
13bc1f51a8 allow clippy lint only on recent enough compilers 2019-11-17 20:47:03 +01:00
Ralf Jung
3415814930 remove redundant namespacing from some features 2019-11-17 20:45:27 +01:00
Gilad Naaman
ef0d8a7bf9 Fixed build for old nightlies where doctests were not present. 2019-11-07 18:43:17 +02:00
Ralf Jung
564d4a6c11 fmt 2019-08-10 11:59:57 +02:00
Ralf Jung
2931fc3024 test README only on nightly, so that it can be a dev-dependency 2019-08-10 11:43:04 +02:00
Gilad Naaman
9a7d4664aa Fixed MaybeUninit for 1.36 2019-07-04 19:33:22 +03:00
Gilad Naaman
31a8de9c2f Fixed soundness issues and removed nested member access. 2019-07-02 20:56:30 +03:00
Gilad Naaman
2d96bfe695 Added dual support for 1.33 and 1.19 2019-03-15 11:38:46 +02:00