aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-09 06:00:40 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-09 06:00:40 +0000
commit875109fb0a99cfd793eb23328d517fbecff271d1 (patch)
tree07eb299a12f6f2438012ce9047c89b2b095f915d
parent782886f1c4dced51e80445b8790b521d7a242a30 (diff)
parentdf849691f3074c6e5086ef022f2e6c808ff00407 (diff)
downloadmemoffset-android13-frc-documentsui-release.tar.gz
Snap for 8558685 from df849691f3074c6e5086ef022f2e6c808ff00407 to tm-frc-documentsui-releaset_frc_doc_330543000t_frc_doc_330443060t_frc_doc_330443000android13-frc-documentsui-release
Change-Id: I315416ec6bcb0efa9ccb93d1aaed4ed76f424ad5
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--.github/workflows/ci.yml86
-rw-r--r--.travis.yml50
-rw-r--r--Android.bp4
-rw-r--r--Cargo.toml11
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA10
-rw-r--r--README.md14
-rw-r--r--TEST_MAPPING36
-rwxr-xr-x[-rw-r--r--]ci/miri.sh0
-rw-r--r--src/lib.rs12
-rw-r--r--src/offset_of.rs6
-rw-r--r--src/span_of.rs3
13 files changed, 139 insertions, 97 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 036fbbe..b737620 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "bbd58f2cbe92d3424d8c3161c46dd5d022c30437"
+ "sha1": "01e2e42ef0d833682c27b0f40a2cc748d86b2dc3"
}
}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..97fcf98
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,86 @@
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+ test:
+ name: Test Suite
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ rust:
+ - stable
+ - beta
+ - nightly
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ toolchain: ${{ matrix.rust }}
+ override: true
+ - name: Run cargo test
+ run: cargo test
+
+ test-msrv:
+ name: Test Suite
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ rust:
+ - 1.19.0 # Oldest supported (first version with numeric fields in struct patterns)
+ - 1.20.0 # Oldest supported with tuple_ty
+ - 1.31.0 # Oldest supported with allow(clippy)
+ - 1.36.0 # Oldest supported with MaybeUninit
+ - 1.40.0 # Oldest supported with cfg(doctest)
+ - 1.51.0 # Oldest supported with ptr::addr_of!
+ - stable
+ - beta
+ - nightly
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ toolchain: ${{ matrix.rust }}
+ override: true
+ - name: Run cargo test
+ # Exclude doctests here, as we don't want to clutter docs themselves
+ # with backwards compatibility workarounds.
+ run: cargo test --lib
+
+ nightly:
+ name: Test Suite (nightly features)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ toolchain: nightly
+ override: true
+ - name: Run cargo test
+ # `--lib` prevents doctests from being run.
+ # This is due to `unstable_const` requiring extra `feature(...)` directives
+ # which the doctests do not have.
+ run: cargo test --all-features --lib
+
+ miri:
+ name: Test Suite (Miri)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Test with Miri
+ run: ci/miri.sh
+
+ style:
+ name: lints and formatting
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.51.0 # pin a version for reproducible results
+ components: rustfmt
+ override: true
+ - name: Check warnings
+ run: RUSTFLAGS="-D warnings" cargo check --all-targets
+ - name: Check formatting
+ run: cargo fmt -- --check
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index d3c4d65..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-sudo: false
-language: rust
-cache:
- cargo: true
-matrix:
- include:
- - name: miri
- env: TRAVIS_MIRI_JOB # make sure the cache is not shared with other "nightly" jobs
- rust: nightly
- script:
- - sh ci/miri.sh
-
- - rust: 1.19.0 # Oldest supported (first version with numeric fields in struct patterns)
- - rust: 1.20.0 # Oldest supported with tuple_ty
- - rust: 1.31.0 # Oldest supported with allow(clippy)
- - rust: 1.36.0 # Oldest supported with MaybeUninit
- - rust: 1.40.0 # Oldest supported with cfg(doctest)
- - rust: 1.51.0 # Oldest supported with ptr::addr_of!
- - rust: stable
- - rust: beta
- - rust: nightly
-
- - name: all-features
- rust: nightly
- script:
- # `--lib` added to prevent doctests from being compiled.
- # This is due to `unstable_const` requiring extra `feature(...)` directives
- # which the doctests do not have.
- - cargo test --verbose --all-features --lib
-
- - name: rustfmt
- rust: 1.36.0
- install:
- - rustup component add rustfmt
- script:
- - cargo fmt -- --check
-
- - name: deny-warnings
- env: RUSTFLAGS="-D warnings"
- rust: 1.33.0 # `stable`: Locking down for consistent behavior
- script:
- - cargo check --tests
-
-install:
-- rustc -Vv
-- cargo -V
-
-script:
-- rm -rf target/debug/deps/*memoffset* # Avoid rustdoc problems
-- cargo test --verbose
diff --git a/Android.bp b/Android.bp
index e0ce329..c8a26b5 100644
--- a/Android.bp
+++ b/Android.bp
@@ -23,7 +23,7 @@ rust_library {
host_supported: true,
crate_name: "memoffset",
cargo_env_compat: true,
- cargo_pkg_version: "0.6.4",
+ cargo_pkg_version: "0.6.5",
srcs: ["src/lib.rs"],
edition: "2015",
features: ["default"],
@@ -49,7 +49,7 @@ rust_test {
host_supported: true,
crate_name: "memoffset",
cargo_env_compat: true,
- cargo_pkg_version: "0.6.4",
+ cargo_pkg_version: "0.6.5",
srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
diff --git a/Cargo.toml b/Cargo.toml
index 5ea1a37..2874e31 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,16 +3,15 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
[package]
name = "memoffset"
-version = "0.6.4"
+version = "0.6.5"
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 d3acd0b..7a62858 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "memoffset"
-version = "0.6.4"
+version = "0.6.5"
authors = ["Gilad Naaman <gilad.naaman@gmail.com>"]
description = "offset_of functionality for Rust structs."
license = "MIT"
diff --git a/METADATA b/METADATA
index b95edfd..7b4d9f1 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/memoffset/memoffset-0.6.4.crate"
+ value: "https://static.crates.io/crates/memoffset/memoffset-0.6.5.crate"
}
- version: "0.6.4"
+ version: "0.6.5"
license_type: NOTICE
last_upgrade_date {
- year: 2021
- month: 6
- day: 21
+ year: 2022
+ month: 3
+ day: 1
}
}
diff --git a/README.md b/README.md
index 52999e3..9e93c2b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# memoffset #
-[![](http://meritbadge.herokuapp.com/memoffset)](https://crates.io/crates/memoffset)
+[![](https://img.shields.io/crates/v/memoffset.svg)](https://crates.io/crates/memoffset)
C-Like `offset_of` functionality for Rust structs.
@@ -21,17 +21,9 @@ memoffset = "0.6"
These versions will compile fine with rustc versions greater or equal to 1.19.
-Add the following lines at the top of your `main.rs` or `lib.rs` files.
-
-```rust,ignore
-#[macro_use]
-extern crate memoffset;
-```
-
## Examples ##
```rust
-#[macro_use]
-extern crate memoffset;
+use memoffset::{offset_of, span_of};
#[repr(C, packed)]
struct Foo {
@@ -69,5 +61,5 @@ features = ["unstable_const"]
Your crate root: (`lib.rs`/`main.rs`)
```rust,ignore
-#![feature(const_ptr_offset_from, const_maybe_uninit_as_ptr, const_raw_ptr_deref, const_refs_to_cell)]
+#![feature(const_ptr_offset_from, const_refs_to_cell)]
```
diff --git a/TEST_MAPPING b/TEST_MAPPING
index eceec2f..83479e2 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -34,6 +34,21 @@
"name": "authfs_device_test_src_lib"
},
{
+ "name": "diced_open_dice_cbor_test"
+ },
+ {
+ "name": "diced_sample_inputs_test"
+ },
+ {
+ "name": "diced_test"
+ },
+ {
+ "name": "diced_utils_test"
+ },
+ {
+ "name": "diced_vendor_test"
+ },
+ {
"name": "keystore2_crypto_test_rust"
},
{
@@ -55,9 +70,6 @@
"name": "microdroid_manager_test"
},
{
- "name": "open_then_run_module"
- },
- {
"name": "virtualizationservice_device_test"
}
],
@@ -72,6 +84,21 @@
"name": "authfs_device_test_src_lib"
},
{
+ "name": "diced_open_dice_cbor_test"
+ },
+ {
+ "name": "diced_sample_inputs_test"
+ },
+ {
+ "name": "diced_test"
+ },
+ {
+ "name": "diced_utils_test"
+ },
+ {
+ "name": "diced_vendor_test"
+ },
+ {
"name": "keystore2_crypto_test_rust"
},
{
@@ -93,9 +120,6 @@
"name": "microdroid_manager_test"
},
{
- "name": "open_then_run_module"
- },
- {
"name": "virtualizationservice_device_test"
}
]
diff --git a/ci/miri.sh b/ci/miri.sh
index 5aea2ec..5aea2ec 100644..100755
--- a/ci/miri.sh
+++ b/ci/miri.sh
diff --git a/src/lib.rs b/src/lib.rs
index 005ea13..1798d91 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,8 +24,7 @@
//!
//! ## Examples
//! ```
-//! #[macro_use]
-//! extern crate memoffset;
+//! use memoffset::{offset_of, span_of};
//!
//! #[repr(C, packed)]
//! struct HelpMeIAmTrappedInAStructFactory {
@@ -60,12 +59,7 @@
//#![no_std]
#![cfg_attr(
feature = "unstable_const",
- feature(
- const_ptr_offset_from,
- const_maybe_uninit_as_ptr,
- const_raw_ptr_deref,
- const_refs_to_cell,
- )
+ feature(const_ptr_offset_from, const_refs_to_cell)
)]
#[macro_use]
@@ -76,7 +70,7 @@ extern crate doc_comment;
#[cfg(doctest)]
doctest!("../README.md");
-/// Hiden module for things the macros need to access.
+/// Hidden module for things the macros need to access.
#[doc(hidden)]
pub mod __priv {
#[doc(hidden)]
diff --git a/src/offset_of.rs b/src/offset_of.rs
index d376498..8596e45 100644
--- a/src/offset_of.rs
+++ b/src/offset_of.rs
@@ -72,8 +72,7 @@ macro_rules! _memoffset_offset_from_unsafe {
///
/// ## Examples
/// ```
-/// #[macro_use]
-/// extern crate memoffset;
+/// use memoffset::offset_of;
///
/// #[repr(C, packed)]
/// struct Foo {
@@ -103,8 +102,7 @@ macro_rules! offset_of {
///
/// ## Examples
/// ```
-/// #[macro_use]
-/// extern crate memoffset;
+/// use memoffset::offset_of_tuple;
///
/// fn main() {
/// assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout");
diff --git a/src/span_of.rs b/src/span_of.rs
index 5fa11ae..a3663d5 100644
--- a/src/span_of.rs
+++ b/src/span_of.rs
@@ -59,8 +59,7 @@ macro_rules! _memoffset__compile_error {
///
/// ## Examples
/// ```
-/// #[macro_use]
-/// extern crate memoffset;
+/// use memoffset::span_of;
///
/// #[repr(C)]
/// struct Florp {