aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-06-22 01:00:25 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-06-22 01:00:25 +0000
commitdd53c5b27bf674d02e43d5fb1e3c198c873ef9c0 (patch)
tree26101cf2c912a7782976c0de155deab1d0d82596
parentfe9af506990f482a5e896d9fcb0a201998d416d9 (diff)
parentbd386db6c26fbfbd143489894b8f4b623f371245 (diff)
downloadmemoffset-dd53c5b27bf674d02e43d5fb1e3c198c873ef9c0.tar.gz
Upgrade rust/crates/memoffset to 0.6.4 am: 692260ca14 am: bd386db6c2
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/memoffset/+/1741438 Change-Id: Iae8d8aeeaa365c3aa9c28e759d7082a6908ec2f9
-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)]