From f4f0115e22332b0c320c85d466d516532f4ca92a Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Wed, 7 Feb 2024 21:26:19 +0100 Subject: Upgrade remain to 0.2.12 This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update external/rust/crates/remain For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Test: TreeHugger Change-Id: Ic78855d22fce79150a837be6eacc94cbbc41039d --- .cargo_vcs_info.json | 2 +- .clippy.toml | 1 - .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++++----- Android.bp | 12 ++++++------ Cargo.toml | 16 +++++++++------- Cargo.toml.orig | 17 +++++++++-------- METADATA | 25 +++++++++++-------------- src/lib.rs | 4 ++-- src/visit.rs | 2 +- tests/stable.rs | 2 +- tests/ui/let-unstable.rs | 2 +- 11 files changed, 73 insertions(+), 47 deletions(-) delete mode 100644 .clippy.toml diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 85fde91..258bfa4 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "d9197a8b0b0b5652c22fc9ded094543544dc83d2" + "sha1": "d933911a0b6aa090c6158eaae3c40a4739b8dbaf" }, "path_in_vcs": "" } \ No newline at end of file diff --git a/.clippy.toml b/.clippy.toml deleted file mode 100644 index 0d369b5..0000000 --- a/.clippy.toml +++ /dev/null @@ -1 +0,0 @@ -msrv = "1.56.0" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a4eee9..9b34038 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly - name: Enable type layout randomization run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV @@ -40,7 +40,7 @@ jobs: rust: [beta, stable, 1.56.0] timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} @@ -48,13 +48,39 @@ jobs: env: RUSTFLAGS: --cfg remain_stable_testing ${{env.RUSTFLAGS}} + minimal: + name: Minimal versions + needs: pre_ci + if: needs.pre_ci.outputs.continue + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - run: cargo generate-lockfile -Z minimal-versions + - run: cargo check --locked + + doc: + name: Documentation + needs: pre_ci + if: needs.pre_ci.outputs.continue + runs-on: ubuntu-latest + timeout-minutes: 45 + env: + RUSTDOCFLAGS: -Dwarnings + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - uses: dtolnay/install@cargo-docs-rs + - run: cargo docs-rs + clippy: name: Clippy runs-on: ubuntu-latest if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@clippy - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic @@ -65,8 +91,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@miri + - run: cargo miri setup - run: cargo miri test env: MIRIFLAGS: -Zmiri-strict-provenance @@ -77,6 +104,6 @@ jobs: if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/install@cargo-outdated - run: cargo outdated --workspace --exit-code 1 diff --git a/Android.bp b/Android.bp index 53c4784..4ee7075 100644 --- a/Android.bp +++ b/Android.bp @@ -41,9 +41,9 @@ rust_proc_macro { name: "libremain", crate_name: "remain", cargo_env_compat: true, - cargo_pkg_version: "0.2.8", + cargo_pkg_version: "0.2.12", srcs: ["src/lib.rs"], - edition: "2018", + edition: "2021", rustlibs: [ "libproc_macro2", "libquote", @@ -55,14 +55,14 @@ rust_test_host { name: "remain_test_tests_stable", crate_name: "stable", cargo_env_compat: true, - cargo_pkg_version: "0.2.8", + cargo_pkg_version: "0.2.12", srcs: ["tests/stable.rs"], test_suites: ["general-tests"], auto_gen_config: true, test_options: { unit_test: true, }, - edition: "2018", + edition: "2021", rustlibs: [ "libproc_macro2", "libquote", @@ -78,14 +78,14 @@ rust_test_host { name: "remain_test_tests_unstable", crate_name: "unstable", cargo_env_compat: true, - cargo_pkg_version: "0.2.8", + cargo_pkg_version: "0.2.12", srcs: ["tests/unstable.rs"], test_suites: ["general-tests"], auto_gen_config: true, test_options: { unit_test: true, }, - edition: "2018", + edition: "2021", rustlibs: [ "libproc_macro2", "libquote", diff --git a/Cargo.toml b/Cargo.toml index 685b30c..a65b7cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" +edition = "2021" rust-version = "1.56" name = "remain" -version = "0.2.8" +version = "0.2.12" authors = ["David Tolnay "] description = "Compile-time checks that an enum, struct, or match is written in sorted order." documentation = "https://docs.rs/remain" @@ -21,32 +21,34 @@ readme = "README.md" categories = [ "development-tools", "no-std", + "no-std::no-alloc", ] license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/remain" [package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] targets = ["x86_64-unknown-linux-gnu"] [lib] proc-macro = true [dependencies.proc-macro2] -version = "1.0" +version = "1.0.74" [dependencies.quote] -version = "1.0" +version = "1.0.35" [dependencies.syn] -version = "2.0" +version = "2.0.46" features = [ "full", "visit-mut", ] [dev-dependencies.rustversion] -version = "1.0" +version = "1.0.13" [dev-dependencies.trybuild] -version = "1.0.49" +version = "1.0.81" features = ["diff"] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index d6cb234..f764958 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,11 +1,11 @@ [package] name = "remain" -version = "0.2.8" +version = "0.2.12" authors = ["David Tolnay "] -categories = ["development-tools", "no-std"] +categories = ["development-tools", "no-std", "no-std::no-alloc"] description = "Compile-time checks that an enum, struct, or match is written in sorted order." documentation = "https://docs.rs/remain" -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/remain" rust-version = "1.56" @@ -14,13 +14,14 @@ rust-version = "1.56" proc-macro = true [dependencies] -proc-macro2 = "1.0" -quote = "1.0" -syn = { version = "2.0", features = ["full", "visit-mut"] } +proc-macro2 = "1.0.74" +quote = "1.0.35" +syn = { version = "2.0.46", features = ["full", "visit-mut"] } [dev-dependencies] -rustversion = "1.0" -trybuild = { version = "1.0.49", features = ["diff"] } +rustversion = "1.0.13" +trybuild = { version = "1.0.81", features = ["diff"] } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +rustdoc-args = ["--generate-link-to-definition"] diff --git a/METADATA b/METADATA index 4bd0564..bf9eb65 100644 --- a/METADATA +++ b/METADATA @@ -1,23 +1,20 @@ # This project was upgraded with external_updater. -# Usage: tools/external_updater/updater.sh update rust/crates/remain -# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md +# Usage: tools/external_updater/updater.sh update external/rust/crates/remain +# For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md name: "remain" description: "Compile-time checks that an enum, struct, or match is written in sorted order." third_party { - url { - type: HOMEPAGE - value: "https://crates.io/crates/remain" - } - url { - type: ARCHIVE - value: "https://static.crates.io/crates/remain/remain-0.2.8.crate" - } - version: "0.2.8" license_type: NOTICE last_upgrade_date { - year: 2023 - month: 3 - day: 27 + year: 2024 + month: 2 + day: 7 + } + homepage: "https://crates.io/crates/remain" + identifier { + type: "Archive" + value: "https://static.crates.io/crates/remain/remain-0.2.12.crate" + version: "0.2.12" } } diff --git a/src/lib.rs b/src/lib.rs index 298c478..44f81b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -143,7 +143,7 @@ //! # fn main() {} //! ``` -#![doc(html_root_url = "https://docs.rs/remain/0.2.8")] +#![doc(html_root_url = "https://docs.rs/remain/0.2.12")] #![allow( clippy::derive_partial_eq_without_eq, clippy::enum_glob_use, @@ -183,7 +183,7 @@ pub fn sorted(args: TokenStream, input: TokenStream) -> TokenStream { let output = TokenStream::from(quote!(#input)); match result { - Ok(_) => output, + Ok(()) => output, Err(err) => emit(&err, kind, output), } } diff --git a/src/visit.rs b/src/visit.rs index 72c07cb..3a4e578 100644 --- a/src/visit.rs +++ b/src/visit.rs @@ -67,7 +67,7 @@ fn check_and_insert_error(input: ExprMatch, out: &mut Expr) { let mut input = Input::Match(input); *out = match crate::check::sorted(&mut input) { - Ok(_) => parse_quote!(#input), + Ok(()) => parse_quote!(#input), Err(err) => { let err = err.to_compile_error(); parse_quote!({ diff --git a/tests/stable.rs b/tests/stable.rs index c67aead..d8df330 100644 --- a/tests/stable.rs +++ b/tests/stable.rs @@ -50,7 +50,7 @@ fn test_let() { let value = TestEnum::A; #[sorted] - let _ = match value { + let () = match value { TestEnum::A => {} #[remain::unsorted] TestEnum::Ignored => {} diff --git a/tests/ui/let-unstable.rs b/tests/ui/let-unstable.rs index 8d65c52..066fa8e 100644 --- a/tests/ui/let-unstable.rs +++ b/tests/ui/let-unstable.rs @@ -1,4 +1,4 @@ -#![feature(proc_macro_hygiene, stmt_expr_attributes)] +#![feature(proc_macro_hygiene)] use remain::sorted; -- cgit v1.2.3