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
Ralf Jung
b30f767bea
remove unnecessary 'cargo miri setup'
2020-08-25 11:58:09 +02:00
Gilad Naaman
0d1ff7814a
Merge pull request #46 from RalfJung/no-transmute
...
use MaybeUninit::as_ptr instead of transmute
2020-08-11 13:39:09 +03:00
Ralf Jung
72768daee9
use MaybeUninit::as_ptr instead of transmute
2020-08-09 18:44:38 +02:00
Roland
608e11823e
Remove const_transmute feature dependency ( #45 )
...
Remove `const_transmute` feature flag
`const_transmute` has been stabilized on current nightly, see https://github.com/rust-lang/rust/pull/72920 .
Document `const_fn_transmute` requirement when using `offset_of!` inside a `const fn`.
Add test for `offset_of!` inside a `const fn`.
2020-07-31 00:21:18 +02:00
Gilad Naaman
e8ee92203a
v0.5.5
2020-07-01 21:55:07 +03:00
Gilad Naaman
bc677e458e
Merge pull request #44 from RalfJung/refactor
...
some reorganization
2020-06-23 11:08:07 +03:00
Ralf Jung
6d5feabd4d
Travis shares caches between jobs unless their env vars differ
2020-06-23 08:51:10 +02:00
Ralf Jung
b1cb4ee2b8
fix allow_clippy
2020-06-22 10:43:53 +02:00
Ralf Jung
fcbad2f16e
share more code in raw_field
2020-06-22 10:07:50 +02:00
Ralf Jung
525c81e24f
factor difference between const and non-const into sub-macro
2020-06-22 10:06:53 +02:00
Ralf Jung
9db8a15115
make the const variant closer to the normal variant (just the offset part is different)
2020-06-21 12:12:34 +02:00
Ralf Jung
78014026d9
span_of: use raw_field macro for more safety
2020-06-21 12:00:25 +02:00
Ralf Jung
f4c1d18544
move raw_field macro to its own file
2020-06-21 11:53:48 +02:00
Gilad Naaman
40015d02f4
Merge pull request #43 from RalfJung/raw_ref
...
add support for using raw_ref macros
2020-06-20 16:37:24 +03:00
Ralf Jung
2745b6ceaa
travis config: avoid setting meaningful env vars
2020-06-20 15:09:16 +02:00
Ralf Jung
720e392281
fmt
2020-06-20 15:02:40 +02:00
Ralf Jung
3f21c8bba3
add support for using raw_ref macros
2020-06-20 14:23:50 +02:00
Gilad Naaman
100d48971d
Merge pull request #42 from RalfJung/version
...
release v0.5.4
2020-03-16 21:46:06 +02:00
Ralf Jung
f7ab3aed26
bump version for release
2020-03-16 20:26:44 +01:00
Gilad Naaman
26777d03a4
Merge pull request #41 from Gilnaa/move_to_autocfg
...
Switch to autocfg from rustc_version
2020-03-16 19:31:08 +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
Gilad Naaman
c57ade7f1f
Merge pull request #40 from RalfJung/raw_field
...
add raw_field macro to compute raw ptr to field
2020-03-16 19:00:52 +02:00