From 6c18e0d43fcc4d667b3ac31c961daff958ca6db7 Mon Sep 17 00:00:00 2001 From: "Kevin R. Thornton" Date: Fri, 6 Sep 2024 08:16:39 -0700 Subject: [PATCH] refactor: update to proc_macro_error2 --- Cargo.lock | 26 +++++++++----------------- tskit-derive/Cargo.toml | 2 +- tskit-derive/src/lib.rs | 10 +++++----- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 12634129b..97b627638 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -420,27 +420,25 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", - "version_check", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-error2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "74cdd32837fa2e86ec09c8266e5aad92400ac934c6dbca83d54673b298db3e45" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", - "version_check", + "syn 2.0.57", ] [[package]] @@ -687,7 +685,7 @@ dependencies = [ name = "tskit-derive" version = "0.2.0" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "quote", "syn 1.0.109", ] @@ -704,12 +702,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/tskit-derive/Cargo.toml b/tskit-derive/Cargo.toml index 9b7e80cd3..324ba19be 100644 --- a/tskit-derive/Cargo.toml +++ b/tskit-derive/Cargo.toml @@ -14,4 +14,4 @@ proc-macro = true [dependencies] syn = { version = "1.0", features = ["derive"] } quote = "1.0" -proc-macro-error = "1.0.4" +proc-macro-error2 = "2.0" diff --git a/tskit-derive/src/lib.rs b/tskit-derive/src/lib.rs index 63730f939..1c4e2bdb6 100644 --- a/tskit-derive/src/lib.rs +++ b/tskit-derive/src/lib.rs @@ -64,25 +64,25 @@ fn impl_metadata_roundtrip_macro(ast: &syn::DeriveInput) -> Result { - #[proc_macro_error::proc_macro_error] + #[proc_macro_error2::proc_macro_error] #[proc_macro_derive($metadatatag, attributes(serializer))] /// Register a type as metadata. pub fn $function(input: TokenStream) -> TokenStream { let ast: syn::DeriveInput = match syn::parse(input) { Ok(ast) => ast, - Err(err) => proc_macro_error::abort!(err), + Err(err) => proc_macro_error2::abort_call_site!(err), }; let mut roundtrip = impl_metadata_roundtrip_macro(&ast).unwrap(); let name = &ast.ident;