aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-06-21 13:27:46 -0700
committerJoel Galenson <jgalenson@google.com>2021-06-21 13:27:46 -0700
commit692260ca148ab7e2e4f68e06c1e00748da012d27 (patch)
tree26101cf2c912a7782976c0de155deab1d0d82596
parentd118dad1e41fd5cac2738190be55a5d5c4f46121 (diff)
downloadmemoffset-692260ca148ab7e2e4f68e06c1e00748da012d27.tar.gz
Upgrade rust/crates/memoffset to 0.6.4
Test: make Change-Id: Idebee12bcb675673f291643fb5c4181cd160da94
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA8
-rw-r--r--README.md4
-rw-r--r--TEST_MAPPING9
-rw-r--r--src/lib.rs3
-rw-r--r--src/offset_of.rs12
8 files changed, 30 insertions, 12 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index fcba615..036fbbe 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "9846cd17f381a5a9b478267ca5c684ab59346283"
+ "sha1": "bbd58f2cbe92d3424d8c3161c46dd5d022c30437"
}
}
diff --git a/Cargo.toml b/Cargo.toml
index e273757..5ea1a37 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@
[package]
name = "memoffset"
-version = "0.6.3"
+version = "0.6.4"
authors = ["Gilad Naaman <gilad.naaman@gmail.com>"]
description = "offset_of functionality for Rust structs."
readme = "README.md"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 9299a64..d3acd0b 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "memoffset"
-version = "0.6.3"
+version = "0.6.4"
authors = ["Gilad Naaman <gilad.naaman@gmail.com>"]
description = "offset_of functionality for Rust structs."
license = "MIT"
diff --git a/METADATA b/METADATA
index 3e6b088..b95edfd 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/memoffset/memoffset-0.6.3.crate"
+ value: "https://static.crates.io/crates/memoffset/memoffset-0.6.4.crate"
}
- version: "0.6.3"
+ version: "0.6.4"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 4
- day: 8
+ month: 6
+ day: 21
}
}
diff --git a/README.md b/README.md
index a60f288..52999e3 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,5 @@ features = ["unstable_const"]
Your crate root: (`lib.rs`/`main.rs`)
```rust,ignore
-#![feature(ptr_offset_from, const_ptr_offset_from, const_maybe_uninit_as_ptr, const_raw_ptr_deref)]
+#![feature(const_ptr_offset_from, const_maybe_uninit_as_ptr, const_raw_ptr_deref, const_refs_to_cell)]
```
-
-If you intend to use `offset_of!` inside a `const fn`, also add the `const_fn` compiler feature.
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 71c00fc..6b913bc 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -5,7 +5,16 @@
"name": "crossbeam-epoch_device_test_src_lib"
},
{
+ "name": "crossbeam-epoch_device_test_tests_loom"
+ },
+ {
"name": "memoffset_device_test_src_lib"
+ },
+ {
+ "name": "unicode-xid_device_test_src_lib"
+ },
+ {
+ "name": "unicode-xid_device_test_tests_exhaustive_tests"
}
]
}
diff --git a/src/lib.rs b/src/lib.rs
index 50d3e10..005ea13 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -61,11 +61,10 @@
#![cfg_attr(
feature = "unstable_const",
feature(
- ptr_offset_from,
- const_fn,
const_ptr_offset_from,
const_maybe_uninit_as_ptr,
const_raw_ptr_deref,
+ const_refs_to_cell,
)
)]
diff --git a/src/offset_of.rs b/src/offset_of.rs
index a363d30..d376498 100644
--- a/src/offset_of.rs
+++ b/src/offset_of.rs
@@ -255,6 +255,18 @@ mod tests {
#[cfg(feature = "unstable_const")]
#[test]
+ fn const_offset_interior_mutable() {
+ #[repr(C)]
+ struct Foo {
+ a: u32,
+ b: core::cell::Cell<u32>,
+ }
+
+ assert_eq!([0; offset_of!(Foo, b)].len(), 4);
+ }
+
+ #[cfg(feature = "unstable_const")]
+ #[test]
fn const_fn_offset() {
const fn test_fn() -> usize {
#[repr(C)]