From 749d3912bb1a833b252c8ae184bd408742f755cf Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 14 Nov 2023 16:35:22 +0000 Subject: Upgrade no-panic to 0.1.26 This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update rust/crates/no-panic For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Test: TreeHugger Change-Id: I2bb11abfdc7c95524f3ef49c85e44b2321fff508 --- .cargo_vcs_info.json | 2 +- .clippy.toml | 1 - .github/workflows/ci.yml | 18 +++++++++++++++--- Android.bp | 4 ++-- Cargo.toml | 23 ++++++++++++++--------- Cargo.toml.orig | 23 ++++++++++++++--------- METADATA | 10 +++++----- README.md | 2 -- patches/syn-2.diff | 14 -------------- src/lib.rs | 10 ++++------ 10 files changed, 55 insertions(+), 52 deletions(-) delete mode 100644 .clippy.toml delete mode 100644 patches/syn-2.diff diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 341a73b..6c24eb8 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "b5c6d7e1df7e423a9543ee9317f63339660743a6" + "sha1": "146c58feff56d594412563b95ff1221b7ae5474d" }, "path_in_vcs": "" } \ No newline at end of file diff --git a/.clippy.toml b/.clippy.toml deleted file mode 100644 index 3d30690..0000000 --- a/.clippy.toml +++ /dev/null @@ -1 +0,0 @@ -msrv = "1.31.0" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 650b0e7..db5726a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [nightly, beta, stable, 1.56.0] + rust: [nightly, beta, stable, 1.63.0] timeout-minutes: 45 steps: - uses: actions/checkout@v3 @@ -61,16 +61,28 @@ jobs: - run: cargo test msrv: - name: Rust 1.31.0 + name: Rust 1.56.0 needs: pre_ci if: needs.pre_ci.outputs.continue runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.31.0 + - uses: dtolnay/rust-toolchain@1.56.0 - run: cargo build + minimal: + name: Minimal versions + needs: pre_ci + if: needs.pre_ci.outputs.continue + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - run: cargo generate-lockfile -Z minimal-versions + - run: cargo check --locked + clippy: name: Clippy runs-on: ubuntu-latest diff --git a/Android.bp b/Android.bp index ff229de..baccb1a 100644 --- a/Android.bp +++ b/Android.bp @@ -41,9 +41,9 @@ rust_proc_macro { name: "libno_panic", crate_name: "no_panic", cargo_env_compat: true, - cargo_pkg_version: "0.1.21", + cargo_pkg_version: "0.1.26", srcs: ["src/lib.rs"], - edition: "2018", + edition: "2021", rustlibs: [ "libproc_macro2", "libquote", diff --git a/Cargo.toml b/Cargo.toml index a183443..9422901 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,39 +10,44 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" -rust-version = "1.31" +edition = "2021" +rust-version = "1.56" name = "no-panic" -version = "0.1.21" +version = "0.1.26" authors = ["David Tolnay "] description = "Attribute macro to require that the compiler prove a function can't ever panic." documentation = "https://docs.rs/no-panic" readme = "README.md" +categories = [ + "no-std", + "no-std::no-alloc", +] license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/no-panic" [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.63" [dependencies.quote] -version = "1.0" +version = "1.0.29" [dependencies.syn] -version = "1.0" +version = "2.0.23" features = ["full"] [dev-dependencies.rustversion] -version = "1.0.9" +version = "1.0.13" [dev-dependencies.tempfile] -version = "3.0" +version = "3.6" [dev-dependencies.trybuild] -version = "1.0.69" +version = "1.0.81" features = ["diff"] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 98bf79c..8ac7ac8 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,26 +1,31 @@ [package] name = "no-panic" -version = "0.1.21" +version = "0.1.26" authors = ["David Tolnay "] +categories = ["no-std", "no-std::no-alloc"] description = "Attribute macro to require that the compiler prove a function can't ever panic." documentation = "https://docs.rs/no-panic" -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/no-panic" -rust-version = "1.31" +rust-version = "1.56" [lib] proc-macro = true [dependencies] -proc-macro2 = "1.0" -quote = "1.0" -syn = { version = "1.0", features = ["full"] } +proc-macro2 = "1.0.63" +quote = "1.0.29" +syn = { version = "2.0.23", features = ["full"] } [dev-dependencies] -rustversion = "1.0.9" -tempfile = "3.0" -trybuild = { version = "1.0.69", features = ["diff"] } +rustversion = "1.0.13" +tempfile = "3.6" +trybuild = { version = "1.0.81", features = ["diff"] } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +rustdoc-args = ["--generate-link-to-definition"] + +[workspace] +members = ["noexcept", "noexcept-impl"] diff --git a/METADATA b/METADATA index 18ed219..62031ac 100644 --- a/METADATA +++ b/METADATA @@ -1,6 +1,6 @@ # This project was upgraded with external_updater. # Usage: tools/external_updater/updater.sh update rust/crates/no-panic -# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md +# For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md name: "no-panic" description: "Attribute macro to require that the compiler prove a function can\'t ever panic." @@ -11,13 +11,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/no-panic/no-panic-0.1.21.crate" + value: "https://static.crates.io/crates/no-panic/no-panic-0.1.26.crate" } - version: "0.1.21" + version: "0.1.26" license_type: NOTICE last_upgrade_date { year: 2023 - month: 3 - day: 6 + month: 11 + day: 14 } } diff --git a/README.md b/README.md index 33dc3cd..e81e6f0 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,6 @@ _panic_demo..demo..__NoPanic$u20$as$u20$core..ops..drop..Drop$GT$4drop17h72f8f42 The error is not stellar but notice the ERROR\[no-panic\] part at the end that provides the name of the offending function. -*Compiler support: requires rustc 1.31+* -
### Caveats diff --git a/patches/syn-2.diff b/patches/syn-2.diff deleted file mode 100644 index f552d50..0000000 --- a/patches/syn-2.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/lib.rs b/src/lib.rs -index d0be8b4..4b9981e 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -239,8 +239,7 @@ fn expand_no_panic(mut function: ItemFn) -> TokenStream2 { - let has_inline = function - .attrs - .iter() -- .flat_map(Attribute::parse_meta) -- .any(|meta| meta.path().is_ident("inline")); -+ .any(|attr| attr.meta.path().is_ident("inline")); - if !has_inline { - function.attrs.push(parse_quote!(#[inline])); - } diff --git a/src/lib.rs b/src/lib.rs index 4b9981e..e8b609f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,8 +66,6 @@ //! The error is not stellar but notice the ERROR\[no-panic\] part at the end //! that provides the name of the offending function. //! -//! *Compiler support: requires rustc 1.31+* -//! //!
//! //! ## Caveats @@ -119,7 +117,7 @@ //! [Kixunil]: https://github.com/Kixunil //! [`dont_panic`]: https://github.com/Kixunil/dont_panic -#![doc(html_root_url = "https://docs.rs/no-panic/0.1.21")] +#![doc(html_root_url = "https://docs.rs/no-panic/0.1.26")] #![allow( clippy::doc_markdown, clippy::match_same_arms, @@ -134,8 +132,8 @@ use proc_macro2::{Span, TokenStream as TokenStream2}; use quote::quote; use syn::parse::{Error, Nothing, Result}; use syn::{ - parse_quote, Attribute, FnArg, GenericArgument, Ident, ItemFn, Pat, PatType, Path, - PathArguments, ReturnType, Token, Type, TypeInfer, TypeParamBound, + parse_quote, FnArg, GenericArgument, Ident, ItemFn, Pat, PatType, Path, PathArguments, + ReturnType, Token, Type, TypeInfer, TypeParamBound, }; #[proc_macro_attribute] @@ -239,7 +237,7 @@ fn expand_no_panic(mut function: ItemFn) -> TokenStream2 { let has_inline = function .attrs .iter() - .any(|attr| attr.meta.path().is_ident("inline")); + .any(|attr| attr.path().is_ident("inline")); if !has_inline { function.attrs.push(parse_quote!(#[inline])); } -- cgit v1.2.3