From cb7e3eb3c6a49e55e518c7bad28491460187019d Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Thu, 26 May 2022 12:09:05 -0700 Subject: Update TEST_MAPPING Test: None Bug: 233924440 Change-Id: I38b6fe4b1a724198763c71bd137bad65ffd025dd --- TEST_MAPPING | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/TEST_MAPPING b/TEST_MAPPING index 129fb3b..e909527 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,5 +1,19 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { + "postsubmit": [ + { + "name": "ZipFuseTest" + }, + { + "name": "apkdmverity.test" + }, + { + "name": "authfs_device_test_src_lib" + }, + { + "name": "virtualizationservice_device_test" + } + ], "presubmit": [ { "name": "ZipFuseTest" -- cgit v1.2.3 From ef0b43574264894c8d59af4bcfde1e12ca3b9a09 Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Tue, 14 Jun 2022 16:54:59 -0700 Subject: Update TEST_MAPPING Test: None Bug: 236006683 Change-Id: I1b41a0b7b177266087e15fd4ef89dbccc38d0ba1 --- TEST_MAPPING | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/TEST_MAPPING b/TEST_MAPPING index e909527..129fb3b 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,19 +1,5 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { - "postsubmit": [ - { - "name": "ZipFuseTest" - }, - { - "name": "apkdmverity.test" - }, - { - "name": "authfs_device_test_src_lib" - }, - { - "name": "virtualizationservice_device_test" - } - ], "presubmit": [ { "name": "ZipFuseTest" -- cgit v1.2.3 From c08482e378a9a7e411141db49dee875068711d68 Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Thu, 7 Jul 2022 10:18:11 +0200 Subject: Enable tests Remove compile tests which require the trybuild crate. Test: atest Change-Id: I6f54734d87e5ef30f50da424b88f597453fa0252 --- Android.bp | 37 ++++++++++++++++++++++++++++++++ cargo2android.json | 6 ++++-- patches/Android.bp.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 patches/Android.bp.patch diff --git a/Android.bp b/Android.bp index fe3e3a5..7c983de 100644 --- a/Android.bp +++ b/Android.bp @@ -50,3 +50,40 @@ rust_proc_macro { "libsyn", ], } + +rust_defaults { + name: "remain_test_defaults", + crate_name: "remain", + cargo_env_compat: true, + cargo_pkg_version: "0.2.2", + test_suites: ["general-tests"], + auto_gen_config: true, + edition: "2018", + rustlibs: [ + "libproc_macro2", + "libquote", + "libsyn", + ], + proc_macros: [ + "libremain", + "librustversion", + ], +} + +rust_test_host { + name: "remain_test_tests_stable", + defaults: ["remain_test_defaults"], + srcs: ["tests/stable.rs"], + test_options: { + unit_test: true, + }, +} + +rust_test_host { + name: "remain_test_tests_unstable", + defaults: ["remain_test_defaults"], + srcs: ["tests/unstable.rs"], + test_options: { + unit_test: true, + }, +} diff --git a/cargo2android.json b/cargo2android.json index 958632b..f1aaae2 100644 --- a/cargo2android.json +++ b/cargo2android.json @@ -1,3 +1,5 @@ { - "run": true -} \ No newline at end of file + "patch": "patches/Android.bp.patch", + "run": true, + "tests": true +} diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch new file mode 100644 index 0000000..592a2fd --- /dev/null +++ b/patches/Android.bp.patch @@ -0,0 +1,56 @@ +diff --git a/Android.bp b/Android.bp +index d175c6d..7c983de 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -51,27 +51,6 @@ rust_proc_macro { + ], + } + +-rust_test_host { +- name: "remain_test_src_lib", +- crate_name: "remain", +- cargo_env_compat: true, +- cargo_pkg_version: "0.2.2", +- srcs: ["src/lib.rs"], +- test_suites: ["general-tests"], +- auto_gen_config: true, +- test_options: { +- unit_test: true, +- }, +- edition: "2018", +- rustlibs: [ +- "libproc_macro2", +- "libquote", +- "libsyn", +- "libtrybuild", +- ], +- proc_macros: ["librustversion"], +-} +- + rust_defaults { + name: "remain_test_defaults", + crate_name: "remain", +@@ -84,7 +63,6 @@ rust_defaults { + "libproc_macro2", + "libquote", + "libsyn", +- "libtrybuild", + ], + proc_macros: [ + "libremain", +@@ -92,15 +70,6 @@ rust_defaults { + ], + } + +-rust_test_host { +- name: "remain_test_tests_compiletest", +- defaults: ["remain_test_defaults"], +- srcs: ["tests/compiletest.rs"], +- test_options: { +- unit_test: true, +- }, +-} +- + rust_test_host { + name: "remain_test_tests_stable", + defaults: ["remain_test_defaults"], -- cgit v1.2.3 From 107bf23690163eb2ce4b02f05158236e08730fbf Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Mon, 19 Dec 2022 08:28:28 +0100 Subject: Update remain to 0.2.6 Test: Treehugger Change-Id: Ibae1230b15dcaa6ef534dfb8b6991bce69c74a8c --- Android.bp | 4 +-- Cargo.toml | 26 ++++++++++----- Cargo.toml.orig | 11 ++++--- METADATA | 11 ++++--- README.md | 4 +-- TEST_MAPPING | 6 ++++ cargo2android.json | 7 ++++- patches/Android.bp.patch | 56 --------------------------------- src/check.rs | 2 +- src/emit.rs | 18 +---------- src/lib.rs | 17 +++++++--- src/parse.rs | 8 ----- tests/compiletest.rs | 1 + tests/order.rs | 1 + tests/stable.rs | 5 +++ tests/ui/enum.stderr | 2 +- tests/ui/let-stable.stderr | 2 +- tests/ui/let-unstable.stderr | 8 ++--- tests/ui/match-stable.stderr | 2 +- tests/ui/match-unstable.stderr | 8 ++--- tests/ui/repeat.stderr | 2 +- tests/ui/struct.stderr | 2 +- tests/ui/unnamed-fields.stderr | 8 ++--- tests/ui/unsorted-enum.stderr | 2 +- tests/ui/unsorted-match-stable.stderr | 2 +- tests/ui/unsorted-match-unstable.stderr | 8 ++--- tests/ui/unsorted-struct.stderr | 2 +- tests/ui/unsupported.stderr | 2 +- tests/unstable.rs | 1 + 29 files changed, 91 insertions(+), 137 deletions(-) delete mode 100644 patches/Android.bp.patch diff --git a/Android.bp b/Android.bp index 7c983de..cb9add3 100644 --- a/Android.bp +++ b/Android.bp @@ -41,7 +41,7 @@ rust_proc_macro { name: "libremain", crate_name: "remain", cargo_env_compat: true, - cargo_pkg_version: "0.2.2", + cargo_pkg_version: "0.2.6", srcs: ["src/lib.rs"], edition: "2018", rustlibs: [ @@ -55,7 +55,7 @@ rust_defaults { name: "remain_test_defaults", crate_name: "remain", cargo_env_compat: true, - cargo_pkg_version: "0.2.2", + cargo_pkg_version: "0.2.6", test_suites: ["general-tests"], auto_gen_config: true, edition: "2018", diff --git a/Cargo.toml b/Cargo.toml index 197d26d..39da45b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,28 +3,34 @@ # 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] edition = "2018" +rust-version = "1.31" name = "remain" -version = "0.2.2" +version = "0.2.6" authors = ["David Tolnay "] description = "Compile-time checks that an enum, struct, or match is written in sorted order." documentation = "https://docs.rs/remain" readme = "README.md" +categories = [ + "development-tools", + "no-std", +] license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/remain" + [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [lib] proc-macro = true + [dependencies.proc-macro2] version = "1.0" @@ -33,10 +39,14 @@ version = "1.0" [dependencies.syn] version = "1.0" -features = ["full", "visit-mut"] +features = [ + "full", + "visit-mut", +] + [dev-dependencies.rustversion] version = "1.0" [dev-dependencies.trybuild] -version = "1.0.19" +version = "1.0.49" features = ["diff"] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index b3328e0..3b64082 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,13 +1,14 @@ [package] name = "remain" -version = "0.2.2" # remember to update number in readme for major versions +version = "0.2.6" authors = ["David Tolnay "] +categories = ["development-tools", "no-std"] +description = "Compile-time checks that an enum, struct, or match is written in sorted order." +documentation = "https://docs.rs/remain" edition = "2018" license = "MIT OR Apache-2.0" -description = "Compile-time checks that an enum, struct, or match is written in sorted order." repository = "https://github.com/dtolnay/remain" -documentation = "https://docs.rs/remain" -readme = "README.md" +rust-version = "1.31" [lib] proc-macro = true @@ -19,7 +20,7 @@ syn = { version = "1.0", features = ["full", "visit-mut"] } [dev-dependencies] rustversion = "1.0" -trybuild = { version = "1.0.19", features = ["diff"] } +trybuild = { version = "1.0.49", features = ["diff"] } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/METADATA b/METADATA index 620b97b..7f97c56 100644 --- a/METADATA +++ b/METADATA @@ -7,13 +7,14 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/remain/remain-0.2.2.crate" + value: "https://static.crates.io/crates/remain/remain-0.2.6.crate" } - version: "0.2.2" + version: "0.2.6" + # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same. license_type: NOTICE last_upgrade_date { - year: 2020 - month: 7 - day: 10 + year: 2022 + month: 12 + day: 19 } } diff --git a/README.md b/README.md index 2a1442f..145f558 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ Remain sorted [github](https://github.com/dtolnay/remain) [crates.io](https://crates.io/crates/remain) -[docs.rs](https://docs.rs/remain) -[build status](https://github.com/dtolnay/remain/actions?query=branch%3Amaster) +[docs.rs](https://docs.rs/remain) +[build status](https://github.com/dtolnay/remain/actions?query=branch%3Amaster) This crate provides an attribute macro to check at compile time that the variants of an enum or the arms of a match expression are written in sorted diff --git a/TEST_MAPPING b/TEST_MAPPING index 129fb3b..ee754ea 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -10,6 +10,9 @@ { "name": "authfs_device_test_src_lib" }, + { + "name": "libdm_rust.test" + }, { "name": "virtualizationservice_device_test" } @@ -24,6 +27,9 @@ { "name": "authfs_device_test_src_lib" }, + { + "name": "libdm_rust.test" + }, { "name": "virtualizationservice_device_test" } diff --git a/cargo2android.json b/cargo2android.json index f1aaae2..f0fb860 100644 --- a/cargo2android.json +++ b/cargo2android.json @@ -1,5 +1,10 @@ { - "patch": "patches/Android.bp.patch", + "dependency-blocklist": [ + "trybuild" + ], + "test-blocklist": [ + "tests/compiletest.rs" + ], "run": true, "tests": true } diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch deleted file mode 100644 index 592a2fd..0000000 --- a/patches/Android.bp.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/Android.bp b/Android.bp -index d175c6d..7c983de 100644 ---- a/Android.bp -+++ b/Android.bp -@@ -51,27 +51,6 @@ rust_proc_macro { - ], - } - --rust_test_host { -- name: "remain_test_src_lib", -- crate_name: "remain", -- cargo_env_compat: true, -- cargo_pkg_version: "0.2.2", -- srcs: ["src/lib.rs"], -- test_suites: ["general-tests"], -- auto_gen_config: true, -- test_options: { -- unit_test: true, -- }, -- edition: "2018", -- rustlibs: [ -- "libproc_macro2", -- "libquote", -- "libsyn", -- "libtrybuild", -- ], -- proc_macros: ["librustversion"], --} -- - rust_defaults { - name: "remain_test_defaults", - crate_name: "remain", -@@ -84,7 +63,6 @@ rust_defaults { - "libproc_macro2", - "libquote", - "libsyn", -- "libtrybuild", - ], - proc_macros: [ - "libremain", -@@ -92,15 +70,6 @@ rust_defaults { - ], - } - --rust_test_host { -- name: "remain_test_tests_compiletest", -- defaults: ["remain_test_defaults"], -- srcs: ["tests/compiletest.rs"], -- test_options: { -- unit_test: true, -- }, --} -- - rust_test_host { - name: "remain_test_tests_stable", - defaults: ["remain_test_defaults"], diff --git a/src/check.rs b/src/check.rs index 0643f5f..39a23e5 100644 --- a/src/check.rs +++ b/src/check.rs @@ -109,7 +109,7 @@ impl Sortable for Arm { }; let segments = match pat { - Pat::Ident(pat) if is_just_ident(&pat) => vec![pat.ident.clone()], + Pat::Ident(pat) if is_just_ident(pat) => vec![pat.ident.clone()], Pat::Path(pat) => idents_of_path(&pat.path), Pat::Struct(pat) => idents_of_path(&pat.path), Pat::TupleStruct(pat) => idents_of_path(&pat.path), diff --git a/src/emit.rs b/src/emit.rs index 4a051ba..c7717aa 100644 --- a/src/emit.rs +++ b/src/emit.rs @@ -1,5 +1,4 @@ use proc_macro::TokenStream; -use proc_macro2::Span; use quote::quote; use syn::Error; @@ -11,13 +10,7 @@ pub enum Kind { Let, } -pub fn emit(err: Error, kind: Kind, output: TokenStream) -> TokenStream { - let mut err = err; - if !probably_has_spans(kind) { - // Otherwise the error is printed without any line number. - err = Error::new(Span::call_site(), &err.to_string()); - } - +pub fn emit(err: &Error, kind: Kind, output: TokenStream) -> TokenStream { let err = err.to_compile_error(); let output = proc_macro2::TokenStream::from(output); @@ -28,12 +21,3 @@ pub fn emit(err: Error, kind: Kind, output: TokenStream) -> TokenStream { TokenStream::from(expanded) } - -// Rustc is so bad at spans. -// https://github.com/rust-lang/rust/issues/43081 -fn probably_has_spans(kind: Kind) -> bool { - match kind { - Kind::Enum | Kind::Struct => true, - Kind::Match | Kind::Let => false, - } -} diff --git a/src/lib.rs b/src/lib.rs index c5c50bf..a043b1f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ //! //! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github //! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust -//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K +//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs //! //!
//! @@ -143,7 +143,15 @@ //! # fn main() {} //! ``` -#![allow(clippy::needless_doctest_main)] +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::enum_glob_use, + clippy::manual_find, + clippy::match_same_arms, + clippy::module_name_repetitions, + clippy::needless_doctest_main, + clippy::similar_names +)] extern crate proc_macro; @@ -157,10 +165,11 @@ mod visit; use proc_macro::TokenStream; use quote::quote; +use syn::parse::Nothing; use syn::{parse_macro_input, ItemFn}; use crate::emit::emit; -use crate::parse::{Input, Nothing}; +use crate::parse::Input; #[proc_macro_attribute] pub fn sorted(args: TokenStream, input: TokenStream) -> TokenStream { @@ -173,7 +182,7 @@ pub fn sorted(args: TokenStream, input: TokenStream) -> TokenStream { match result { Ok(_) => output, - Err(err) => emit(err, kind, output), + Err(err) => emit(&err, kind, output), } } diff --git a/src/parse.rs b/src/parse.rs index aff4972..66f80fe 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -5,14 +5,6 @@ use syn::{Attribute, Error, Expr, Fields, Result, Stmt, Token, Visibility}; use crate::emit::Kind; -pub struct Nothing; - -impl Parse for Nothing { - fn parse(_input: ParseStream) -> Result { - Ok(Nothing) - } -} - pub enum Input { Enum(syn::ItemEnum), Match(syn::ExprMatch), diff --git a/tests/compiletest.rs b/tests/compiletest.rs index f9aea23..7974a62 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -1,4 +1,5 @@ #[rustversion::attr(not(nightly), ignore)] +#[cfg_attr(miri, ignore)] #[test] fn ui() { let t = trybuild::TestCases::new(); diff --git a/tests/order.rs b/tests/order.rs index 4723f94..9020ef9 100644 --- a/tests/order.rs +++ b/tests/order.rs @@ -1,4 +1,5 @@ #![allow(dead_code, non_camel_case_types)] +#![allow(clippy::enum_variant_names, clippy::upper_case_acronyms)] #[remain::sorted] enum UnderscoresFirst { diff --git a/tests/stable.rs b/tests/stable.rs index b1bcd65..6207079 100644 --- a/tests/stable.rs +++ b/tests/stable.rs @@ -1,4 +1,9 @@ #![allow(dead_code)] +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::let_unit_value, + clippy::match_same_arms +)] #[remain::sorted] #[derive(PartialEq)] diff --git a/tests/ui/enum.stderr b/tests/ui/enum.stderr index 50ffa8c..0d23e00 100644 --- a/tests/ui/enum.stderr +++ b/tests/ui/enum.stderr @@ -1,5 +1,5 @@ error: Bbb should sort before Ccc - --> $DIR/enum.rs:8:5 + --> tests/ui/enum.rs:8:5 | 8 | Bbb(u8, u8), | ^^^ diff --git a/tests/ui/let-stable.stderr b/tests/ui/let-stable.stderr index 9073750..9c7a937 100644 --- a/tests/ui/let-stable.stderr +++ b/tests/ui/let-stable.stderr @@ -1,5 +1,5 @@ error: E::Bbb should sort before E::Ccc - --> $DIR/let-stable.rs:17:9 + --> tests/ui/let-stable.rs:17:9 | 17 | E::Bbb(_, _) => {} | ^^^^^^ diff --git a/tests/ui/let-unstable.stderr b/tests/ui/let-unstable.stderr index 0960dba..4f5e6ee 100644 --- a/tests/ui/let-unstable.stderr +++ b/tests/ui/let-unstable.stderr @@ -1,7 +1,5 @@ error: E::Bbb should sort before E::Ccc - --> $DIR/let-unstable.rs:15:5 + --> tests/ui/let-unstable.rs:20:9 | -15 | #[sorted] - | ^^^^^^^^^ - | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) +20 | E::Bbb(_, _) => {} + | ^^^^^^ diff --git a/tests/ui/match-stable.stderr b/tests/ui/match-stable.stderr index 183daa9..ff18739 100644 --- a/tests/ui/match-stable.stderr +++ b/tests/ui/match-stable.stderr @@ -1,5 +1,5 @@ error: E::Bbb should sort before E::Ccc - --> $DIR/match-stable.rs:17:9 + --> tests/ui/match-stable.rs:17:9 | 17 | E::Bbb(_, _) => {} | ^^^^^^ diff --git a/tests/ui/match-unstable.stderr b/tests/ui/match-unstable.stderr index 56872fb..e406aab 100644 --- a/tests/ui/match-unstable.stderr +++ b/tests/ui/match-unstable.stderr @@ -1,7 +1,5 @@ error: E::Bbb should sort before E::Ccc - --> $DIR/match-unstable.rs:15:5 + --> tests/ui/match-unstable.rs:20:9 | -15 | #[sorted] - | ^^^^^^^^^ - | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) +20 | E::Bbb(_, _) => {} + | ^^^^^^ diff --git a/tests/ui/repeat.stderr b/tests/ui/repeat.stderr index 4dbf277..37b3c86 100644 --- a/tests/ui/repeat.stderr +++ b/tests/ui/repeat.stderr @@ -1,5 +1,5 @@ error: E::Aaa should sort before E::Bbb - --> $DIR/repeat.rs:12:9 + --> tests/ui/repeat.rs:12:9 | 12 | E::Aaa(_) => {} | ^^^^^^ diff --git a/tests/ui/struct.stderr b/tests/ui/struct.stderr index 2ead15b..fa3dc4d 100644 --- a/tests/ui/struct.stderr +++ b/tests/ui/struct.stderr @@ -1,5 +1,5 @@ error: c should sort before d - --> $DIR/struct.rs:6:5 + --> tests/ui/struct.rs:6:5 | 6 | c: usize, | ^ diff --git a/tests/ui/unnamed-fields.stderr b/tests/ui/unnamed-fields.stderr index 618fb22..249b58c 100644 --- a/tests/ui/unnamed-fields.stderr +++ b/tests/ui/unnamed-fields.stderr @@ -1,15 +1,15 @@ error: expected enum, struct, or match expression - --> $DIR/unnamed-fields.rs:1:1 + --> tests/ui/unnamed-fields.rs:1:1 | 1 | #[remain::sorted] | ^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `remain::sorted` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected enum, struct, or match expression - --> $DIR/unnamed-fields.rs:4:1 + --> tests/ui/unnamed-fields.rs:4:1 | 4 | #[remain::sorted] | ^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `remain::sorted` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/unsorted-enum.stderr b/tests/ui/unsorted-enum.stderr index 249d171..7ea243e 100644 --- a/tests/ui/unsorted-enum.stderr +++ b/tests/ui/unsorted-enum.stderr @@ -1,5 +1,5 @@ error: Bbb should sort before Ccc - --> $DIR/unsorted-enum.rs:9:5 + --> tests/ui/unsorted-enum.rs:9:5 | 9 | Bbb(u8, u8), | ^^^ diff --git a/tests/ui/unsorted-match-stable.stderr b/tests/ui/unsorted-match-stable.stderr index d04d317..623078e 100644 --- a/tests/ui/unsorted-match-stable.stderr +++ b/tests/ui/unsorted-match-stable.stderr @@ -1,5 +1,5 @@ error: E::Bbb should sort before E::Ccc - --> $DIR/unsorted-match-stable.rs:18:9 + --> tests/ui/unsorted-match-stable.rs:18:9 | 18 | E::Bbb(_, _) => {} | ^^^^^^ diff --git a/tests/ui/unsorted-match-unstable.stderr b/tests/ui/unsorted-match-unstable.stderr index 386860b..42daef5 100644 --- a/tests/ui/unsorted-match-unstable.stderr +++ b/tests/ui/unsorted-match-unstable.stderr @@ -1,7 +1,5 @@ error: E::Bbb should sort before E::Ddd - --> $DIR/unsorted-match-unstable.rs:15:5 + --> tests/ui/unsorted-match-unstable.rs:21:9 | -15 | #[sorted] - | ^^^^^^^^^ - | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) +21 | E::Bbb(_, _) => {} + | ^^^^^^ diff --git a/tests/ui/unsorted-struct.stderr b/tests/ui/unsorted-struct.stderr index 84509d7..7b3b0ad 100644 --- a/tests/ui/unsorted-struct.stderr +++ b/tests/ui/unsorted-struct.stderr @@ -1,5 +1,5 @@ error: a should sort before d - --> $DIR/unsorted-struct.rs:8:5 + --> tests/ui/unsorted-struct.rs:8:5 | 8 | a: usize, | ^ diff --git a/tests/ui/unsupported.stderr b/tests/ui/unsupported.stderr index e471e1e..df47b9c 100644 --- a/tests/ui/unsupported.stderr +++ b/tests/ui/unsupported.stderr @@ -1,5 +1,5 @@ error: unsupported by #[remain::sorted] - --> $DIR/unsupported.rs:7:9 + --> tests/ui/unsupported.rs:7:9 | 7 | 0..=20 => {} | ^^^^^^ diff --git a/tests/unstable.rs b/tests/unstable.rs index 1c94950..c0a0c65 100644 --- a/tests/unstable.rs +++ b/tests/unstable.rs @@ -1,6 +1,7 @@ #![allow(dead_code)] #![cfg(not(remain_stable_testing))] #![feature(proc_macro_hygiene, stmt_expr_attributes)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::match_same_arms)] #[remain::sorted] #[derive(PartialEq)] -- cgit v1.2.3 From 2281da51eb87aaa617900f00daf320ce983fbfbc Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Mon, 23 Jan 2023 14:00:19 +0000 Subject: Update TEST_MAPPING Test: None Change-Id: I4840e0c1faf17e5ecf652e6d69d0eb82aad1c83a --- TEST_MAPPING | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/TEST_MAPPING b/TEST_MAPPING index ee754ea..4f9dfe4 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -10,11 +10,17 @@ { "name": "authfs_device_test_src_lib" }, + { + "name": "encryptedstore.test" + }, { "name": "libdm_rust.test" }, { - "name": "virtualizationservice_device_test" + "name": "libpvmfw_avb.integration_test" + }, + { + "name": "virtualizationmanager_device_test" } ], "presubmit-rust": [ @@ -27,11 +33,17 @@ { "name": "authfs_device_test_src_lib" }, + { + "name": "encryptedstore.test" + }, { "name": "libdm_rust.test" }, { - "name": "virtualizationservice_device_test" + "name": "libpvmfw_avb.integration_test" + }, + { + "name": "virtualizationmanager_device_test" } ] } -- cgit v1.2.3 From 2ace9eb7e026444cbc1f4d24829105f56e4795d6 Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Mon, 30 Jan 2023 13:21:46 +0100 Subject: Update TEST_MAPPING Test: atest Change-Id: I44607f3493b79c14bd0f1d952d9292acd0a23779 --- TEST_MAPPING | 40 +++++++--------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/TEST_MAPPING b/TEST_MAPPING index 4f9dfe4..582eb1e 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,49 +1,23 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { - "presubmit": [ + "imports": [ { - "name": "ZipFuseTest" + "path": "packages/modules/Virtualization/apkdmverity" }, { - "name": "apkdmverity.test" + "path": "packages/modules/Virtualization/authfs" }, { - "name": "authfs_device_test_src_lib" + "path": "packages/modules/Virtualization/encryptedstore" }, { - "name": "encryptedstore.test" + "path": "packages/modules/Virtualization/libs/devicemapper" }, { - "name": "libdm_rust.test" + "path": "packages/modules/Virtualization/virtualizationmanager" }, { - "name": "libpvmfw_avb.integration_test" - }, - { - "name": "virtualizationmanager_device_test" - } - ], - "presubmit-rust": [ - { - "name": "ZipFuseTest" - }, - { - "name": "apkdmverity.test" - }, - { - "name": "authfs_device_test_src_lib" - }, - { - "name": "encryptedstore.test" - }, - { - "name": "libdm_rust.test" - }, - { - "name": "libpvmfw_avb.integration_test" - }, - { - "name": "virtualizationmanager_device_test" + "path": "packages/modules/Virtualization/zipfuse" } ] } -- cgit v1.2.3 From 5b5c98722e92ed4539f7c6322999470c6b248ec5 Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Tue, 7 Mar 2023 17:24:42 -0800 Subject: Make remain available to product and vendor Bug: 270690570 Test: mma in external/rust/crates Change-Id: Iad0c3a0766bb450da25a2ea2e7ea07e02845d76b --- Android.bp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Android.bp b/Android.bp index cb9add3..26a3eff 100644 --- a/Android.bp +++ b/Android.bp @@ -49,6 +49,8 @@ rust_proc_macro { "libquote", "libsyn", ], + product_available: true, + vendor_available: true, } rust_defaults { -- cgit v1.2.3