Commit Graph

159 Commits

Author SHA1 Message Date
openharmony_ci 94040379e7 !2 Add OAT.xml and README.OpenSource
Merge pull request !2 from fangting/master
OpenHarmony-v6.0-Beta1 OpenHarmony-v4.1.4-Release OpenHarmony-v5.1.0-Release OpenHarmony-v5.0.3-Release OpenHarmony-v4.1.3-Release OpenHarmony-v5.0.2-Release OpenHarmony-v4.1.2-Release OpenHarmony-v5.0.1-Release OpenHarmony-v4.0.4-Release OpenHarmony-v5.0.0-Release OpenHarmony-v4.0.3-Release OpenHarmony-v4.0.2-Release OpenHarmony-v5.0-Beta1 OpenHarmony-v4.0-Beta1 OpenHarmony-v4.0-Beta2 OpenHarmony-v4.0-Release OpenHarmony-v4.0.1-Release OpenHarmony-v4.1-Beta1 OpenHarmony-v4.1-Release OpenHarmony-v4.1.1-Release master-v weekly_20240115-v
2023-04-14 08:10:35 +00:00
fangting 2099ad4dd8 Add OAT.xml and README.OpenSource
Signed-off-by: fangting <fangting12@huawei.com>
2023-04-14 14:15:06 +08:00
openharmony_ci 640c0e2b91 !1 [memoffset]Add OH support and BUILD.gn for rust
Merge pull request !1 from haotuo/master
2023-04-13 11:33:55 +00:00
haotuo a73e471dbd Add BUILD.gn for OH build
Issue:https://gitee.com/openharmony/build/issues/I6UFTP

Signed-off-by: haotuo <haotuo@huawei.com>
2023-04-12 09:34:53 +08:00
Gilad Naaman 700fb0337a Version 0.8.0
Support for const-eval on stable
github.com/Gilnaa/memoffset/v0.8.0
2022-12-15 20:26:53 +02:00
Gilad Naaman 05d3574a04 Merge pull request #70 from Gilnaa/gilad-4-stable-const
Automatically enable const evaluation
2022-12-11 12:10:46 -08:00
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
Gilad Naaman 9e43539733 Version 0.7.1
Re-publish with updated README
2022-10-17 09:29:35 +03:00
Gilad Naaman 41ef7d3c48 Updated version in README 2022-10-17 09:28:40 +03:00
Gilad Naaman 979508af3c Version 0.7.0
Support unions and update docs:
 - https://github.com/Gilnaa/memoffset/issues/66
 - https://github.com/Gilnaa/memoffset/issues/23
 - https://github.com/Gilnaa/memoffset/issues/59
2022-10-17 09:25:20 +03:00
Gilad Naaman f1fcd46d16 Update docs WRT repr(Rust) (#69)
Issue:
 - https://github.com/Gilnaa/memoffset/issues/59
2022-10-16 16:49:41 +02:00
Gilad Naaman d5f5514c7d Add some compile-fail tests. (#68)
Ticket:
 - https://github.com/Gilnaa/memoffset/issues/23
2022-10-10 21:00:44 +02:00
Gilad Naaman 4c734cb150 Merge pull request #67 from Gilnaa/union-issue-66
Support unions in offset_of(_union)
2022-10-10 20:51:55 +03:00
Gilad Naaman e28945c4ff Update src/raw_field.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2022-10-10 20:46:09 +03:00
Gilad Naaman e963055298 Update src/offset_of.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2022-10-10 20:45:55 +03:00
Gilad Naaman 9af1ea0b8e Support unions in offset_of(_union) 2022-10-10 17:48:18 +03:00
Gilad Naaman c845f0ed19 Merge pull request #65 from RalfJung/miri
update Miri CI config
2022-03-08 10:34:51 -08:00
Ralf Jung e6be60eeb5 update Miri CI config 2022-03-08 13:16:23 -05:00
yvt 757c7ece28 Suppress clippy::unneeded_wildcard_pattern (#64) 2022-02-23 22:19:16 -05:00
Gilad Naaman b2e19f643c v0.6.5 2021-12-03 18:26:55 +02:00
Gilad Naaman 17c30dbc6f Merge pull request #63 from yvt/fix-nightly
Fix `unstable_const` for the latest compiler
2021-12-03 16:18:05 +02:00
yvt a0e5563c97 Remove #![feature(const_raw_ptr_deref)]
It's now stable in nightly.
2021-12-03 22:22:23 +09:00
yvt e3bcb9ebf4 Remove #![feature(const_maybe_uninit_as_ptr)]
It's now stable in nightly.
2021-12-03 22:21:14 +09:00
Gilad Naaman 9454386262 Merge pull request #62 from matklad/idioms
Modernize doc examples to use idiomatic Rust
2021-11-12 13:14:20 +02:00
Aleksey Kladov 8603683bb3 only doctest on modern Rust 2021-11-12 14:05:15 +03:00
Aleksey Kladov db4bebb157 Modernize doc examples to use idiomatic Rust 2021-11-12 13:34:44 +03:00
Gilad Naaman b6c2c7fe7d Merge pull request #61 from atouchet/badge
Fix crates.io badge
2021-09-03 23:03:01 +03:00
Alex Touchet 5e3cb86e6d Fix crates.io badge 2021-09-03 12:56:29 -07:00
Gilad Naaman 58946c89d2 Merge pull request #60 from RalfJung/ci
switch to GHA
2021-07-11 06:16:30 -07:00
Ralf Jung 51dc8f779d switch to GHA 2021-07-11 14:58:43 +02:00
Gilad Naaman 830ced6d41 v0.6.4 2021-05-27 17:21:15 +03:00
Gilad Naaman fe6d2998c5 Merge pull request #56 from RalfJung/const_fn
the const_fn compiler feature is a NOP
2021-05-04 21:39:09 -07:00
Ralf Jung cdb06e8793 the const_fn compiler feature is a NOP 2021-05-04 17:35:33 +02:00
Gilad Naaman ed082efe4d Merge pull request #55 from RalfJung/const
update feature flags and docs for const offset_of
2021-03-28 22:29:51 +03:00
Ralf Jung 3b62693126 update feature flags and docs for const offset_of 2021-03-28 18:59:07 +02:00
Gilad Naaman ea7192f5bf v0.6.3 2021-03-28 13:11:22 +03:00
Gilad Naaman 45227f1e45 Merge pull request #54 from RalfJung/span_of_soundness
Make span_of sound
2021-03-27 18:50:23 +03:00
Ralf Jung e7a50fcff7 fix build on old rustc 2021-03-27 15:30:05 +01:00
Ralf Jung 13cb07f475 test all versions that are significant in build.rs 2021-03-27 15:26:49 +01:00
Ralf Jung 8c73417444 move mem and ptr into __priv 2021-03-27 15:26:49 +01:00
Ralf Jung fb1961c64a avoid use of size_of_val in span_of 2021-03-27 15:21:43 +01:00
Ralf Jung c4263a9d94 rename _memoffset_offset_from macro to reflect that it is unsafe to call 2021-03-26 09:52:02 +01:00
Gilad Naaman 3114acff6c Merge pull request #53 from RalfJung/unsafe
avoid putting user code inside unsafe blocks
2021-03-26 11:39:43 +03:00
Gilad Naaman 03e6254ac1 v0.6.2 2021-03-26 03:36:12 +03:00
Ralf Jung 78dbf5752f avoid putting user code inside unsafe blocks 2021-03-26 00:01:10 +01: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
Gilad Naaman 664896e766 v0.6.1 (doc fixes) 2020-10-23 16:16:30 +03:00
Gilad Naaman 1c24ad1441 v0.6.0 2020-10-23 16:16:24 +03: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 4832512e36 v0.5.6 2020-09-20 14:54:44 +03:00