Skip to content

Commit 00e2367

Browse files
authored
refactor: update to proc_macro_error2 (#661)
1 parent 3310ff2 commit 00e2367

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

Diff for: Cargo.lock

+9-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: tskit-derive/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ proc-macro = true
1414
[dependencies]
1515
syn = { version = "1.0", features = ["derive"] }
1616
quote = "1.0"
17-
proc-macro-error = "1.0.4"
17+
proc-macro-error2 = "2.0"

Diff for: tskit-derive/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,25 @@ fn impl_metadata_roundtrip_macro(ast: &syn::DeriveInput) -> Result<TokenStream,
6464
} else if &serializer == "bincode" {
6565
return Ok(impl_serde_bincode_roundtrip(name));
6666
} else {
67-
proc_macro_error::abort!(serializer, "is not a supported protocol.");
67+
proc_macro_error2::abort!(serializer, "is not a supported protocol.");
6868
}
6969
} else {
70-
proc_macro_error::abort!(attr.path, "is not a supported attribute.");
70+
proc_macro_error2::abort!(attr.path, "is not a supported attribute.");
7171
}
7272
}
7373

74-
proc_macro_error::abort_call_site!("missing [serializer(...)] attribute")
74+
proc_macro_error2::abort_call_site!("missing [serializer(...)] attribute")
7575
}
7676

7777
macro_rules! make_derive_metadata_tag {
7878
($function: ident, $metadatatag: ident) => {
79-
#[proc_macro_error::proc_macro_error]
79+
#[proc_macro_error2::proc_macro_error]
8080
#[proc_macro_derive($metadatatag, attributes(serializer))]
8181
/// Register a type as metadata.
8282
pub fn $function(input: TokenStream) -> TokenStream {
8383
let ast: syn::DeriveInput = match syn::parse(input) {
8484
Ok(ast) => ast,
85-
Err(err) => proc_macro_error::abort!(err),
85+
Err(err) => proc_macro_error2::abort_call_site!(err),
8686
};
8787
let mut roundtrip = impl_metadata_roundtrip_macro(&ast).unwrap();
8888
let name = &ast.ident;

0 commit comments

Comments
 (0)