diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-17 07:33:17 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-17 07:33:17 +0000 |
commit | 08116d09639ad20891bd149b58442824a3784cd5 (patch) | |
tree | d361da931e8c52ac15db3459546733dea4d562b9 | |
parent | bd0bc7be90d05d9978bfbd09c10cfb88f014cd55 (diff) | |
parent | 685133a9cf208b8c92f7d024096afef20ec816c9 (diff) | |
download | matches-08116d09639ad20891bd149b58442824a3784cd5.tar.gz |
Snap for 8603585 from 685133a9cf208b8c92f7d024096afef20ec816c9 to mainline-tzdata3-release
Change-Id: I66099f18d4a9c36c37119b954a07936c98ff830f
-rw-r--r-- | Android.bp | 50 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 10 | ||||
-rw-r--r-- | TEST_MAPPING | 32 | ||||
-rw-r--r-- | lib.rs | 5 | ||||
-rw-r--r-- | patches/std.diff | 13 | ||||
-rw-r--r-- | tests/use_star.rs | 10 |
8 files changed, 90 insertions, 36 deletions
@@ -23,6 +23,8 @@ rust_library { // has rustc warnings host_supported: true, crate_name: "matches", + cargo_env_compat: true, + cargo_pkg_version: "0.1.9", srcs: ["lib.rs"], edition: "2015", apex_available: [ @@ -32,34 +34,27 @@ rust_library { min_sdk_version: "29", } -rust_defaults { - name: "matches_defaults", - crate_name: "matches", +rust_test { + name: "matches_test_lib", // has rustc warnings + host_supported: true, + crate_name: "matches", + cargo_env_compat: true, + cargo_pkg_version: "0.1.9", srcs: ["lib.rs"], test_suites: ["general-tests"], auto_gen_config: true, - edition: "2015", -} - -rust_test_host { - name: "matches_host_test_lib", - defaults: ["matches_defaults"], test_options: { unit_test: true, }, -} - -rust_test { - name: "matches_device_test_lib", - defaults: ["matches_defaults"], + edition: "2015", } rust_defaults { - name: "matches_defaults_macro_use_one", - crate_name: "macro_use_one", - // has rustc warnings - srcs: ["tests/macro_use_one.rs"], + name: "matches_test_defaults", + crate_name: "matches", + cargo_env_compat: true, + cargo_pkg_version: "0.1.9", test_suites: ["general-tests"], auto_gen_config: true, edition: "2015", @@ -68,15 +63,24 @@ rust_defaults { ], } -rust_test_host { - name: "matches_host_test_tests_macro_use_one", - defaults: ["matches_defaults_macro_use_one"], +rust_test { + name: "matches_test_tests_macro_use_one", + defaults: ["matches_test_defaults"], + // has rustc warnings + host_supported: true, + srcs: ["tests/macro_use_one.rs"], test_options: { unit_test: true, }, } rust_test { - name: "matches_device_test_tests_macro_use_one", - defaults: ["matches_defaults_macro_use_one"], + name: "matches_test_tests_use_star", + defaults: ["matches_test_defaults"], + // has rustc warnings + host_supported: true, + srcs: ["tests/use_star.rs"], + test_options: { + unit_test: true, + }, } @@ -3,7 +3,7 @@ # 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 @@ -12,7 +12,7 @@ [package] name = "matches" -version = "0.1.8" +version = "0.1.9" authors = ["Simon Sapin <simon.sapin@exyr.org>"] description = "A macro to evaluate, as a boolean, whether an expression matches a pattern." documentation = "https://docs.rs/matches/" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index afc7422..bf12269 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "matches" -version = "0.1.8" +version = "0.1.9" authors = ["Simon Sapin <simon.sapin@exyr.org>"] license = "MIT" repository = "https://github.com/SimonSapin/rust-std-candidates" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/matches/matches-0.1.8.crate" + value: "https://static.crates.io/crates/matches/matches-0.1.9.crate" } - version: "0.1.8" + version: "0.1.9" license_type: NOTICE last_upgrade_date { - year: 2020 - month: 12 - day: 15 + year: 2021 + month: 9 + day: 23 } } diff --git a/TEST_MAPPING b/TEST_MAPPING index 138b36c..577d626 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,17 +1,39 @@ -// Generated by cargo2android.py for tests that depend on this crate. +// Generated by update_crate_tests.py for tests that depend on this crate. { + "imports": [ + { + "path": "external/rust/crates/quiche" + }, + { + "path": "external/rust/crates/url" + } + ], "presubmit": [ { - "name": "matches_device_test_lib" + "name": "doh_unit_test" + }, + { + "name": "matches_test_lib" + }, + { + "name": "matches_test_tests_macro_use_one" + }, + { + "name": "matches_test_tests_use_star" + } + ], + "presubmit-rust": [ + { + "name": "doh_unit_test" }, { - "name": "url_device_test_src_lib" + "name": "matches_test_lib" }, { - "name": "unicode-bidi_device_test_src_lib" + "name": "matches_test_tests_macro_use_one" }, { - "name": "matches_device_test_tests_macro_use_one" + "name": "matches_test_tests_use_star" } ] } @@ -1,3 +1,8 @@ +#![no_std] + +// ANDROID: Use std to allow building as a dylib. +extern crate std; + /// Check if an expression matches a refutable pattern. /// /// Syntax: `matches!(` *expression* `,` *pattern* `)` diff --git a/patches/std.diff b/patches/std.diff new file mode 100644 index 0000000..371910c --- /dev/null +++ b/patches/std.diff @@ -0,0 +1,13 @@ +diff --git a/lib.rs b/lib.rs +index 3bcd6e2..01ccbf9 100644 +--- a/lib.rs ++++ b/lib.rs +@@ -1,5 +1,8 @@ + #![no_std] + ++// ANDROID: Use std to allow building as a dylib. ++extern crate std; ++ + /// Check if an expression matches a refutable pattern. + /// + /// Syntax: `matches!(` *expression* `,` *pattern* `)` diff --git a/tests/use_star.rs b/tests/use_star.rs new file mode 100644 index 0000000..58a670b --- /dev/null +++ b/tests/use_star.rs @@ -0,0 +1,10 @@ +//! https://github.com/SimonSapin/rust-std-candidates/issues/22 + +extern crate matches; + +use matches::*; + +#[test] +fn test_assert_matches() { + assert_matches!(4, 4) +} |