Repository: kellpossible/cargo-i18n (language: rust)

Issue:
`proc-macro-error` (dependency of `i18n-embed-fl`) is unmaintained
The last release of `proc-macro-error` was 3.5 years ago. It appears that the author of `proc-macro-error` has been AFK from their GitLab for around 2.5 years, which in particular means that `proc-macro-error` is not being updated to use `syn 2` (see e.g. https://gitlab.com/CreepySkeleton/proc-macro-error/-/merge_requests/35).

From the discussions around `proc-macro-error` there appear to be two maintained alternatives:
- [`proc-macro2-diagnostics`](https://crates.io/crates/proc-macro2-diagnostics)
- [`manyhow`](https://crates.io/crates/manyhow)


Discussion / hints:
@str4d thanks for the heads up!

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 020742d..edb0801 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -271,7 +271,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.72",
+ "syn",
 ]
 
 [[package]]
@@ -642,12 +642,12 @@ dependencies = [
  "i18n-embed",
  "lazy_static",
  "pretty_assertions",
- "proc-macro-error",
+ "proc-macro-error2",
  "proc-macro2",
  "quote",
  "rust-embed",
  "strsim",
- "syn 2.0.72",
+ "syn",
  "unic-langid",
 ]
 
@@ -660,7 +660,7 @@ dependencies = [
  "proc-macro2",
  "quote",
  "rust-embed",
- "syn 2.0.72",
+ "syn",
 ]
 
 [[package]]
@@ -921,27 +921,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.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
 dependencies = [
+ "proc-macro-error-attr2",
  "proc-macro2",
  "quote",
- "version_check",
+ "syn",
 ]
 
 [[package]]
@@ -1029,7 +1027,7 @@ dependencies = [
  "proc-macro2",
  "quote",
  "rust-embed-utils",
- "syn 2.0.72",
+ "syn",
  "walkdir",
 ]
 
@@ -1111,7 +1109,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.72",
+ "syn",
 ]
 
 [[package]]
@@ -1136,7 +1134,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.72",
+ "syn",
 ]
 
 [[package]]
@@ -1181,16 +1179,6 @@ dependencies = [
  "winapi",
 ]
 
-[[package]]
-name = "syn"
-version = "1.0.109"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
-dependencies = [
- "proc-macro2",
- "unicode-ident",
-]
-
 [[package]]
 name = "syn"
 version = "2.0.72"
@@ -1225,7 +1213,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.72",
+ "syn",
 ]
 
 [[package]]
@@ -1346,7 +1334,7 @@ dependencies = [
  "once_cell",
  "proc-macro2",
  "quote",
- "syn 2.0.72",
+ "syn",
  "wasm-bindgen-shared",
 ]
 
@@ -1368,7 +1356,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.72",
+ "syn",
  "wasm-bindgen-backend",
  "wasm-bindgen-shared",
 ]
diff --git a/i18n-embed-fl/Cargo.toml b/i18n-embed-fl/Cargo.toml
index fdffc3b..bd44a02 100644
--- a/i18n-embed-fl/Cargo.toml
+++ b/i18n-embed-fl/Cargo.toml
@@ -19,7 +19,7 @@ i18n-config = { workspace = true }
 i18n-embed = { workspace = true, features = ["fluent-system", "filesystem-assets"]}
 lazy_static = { workspace = true }
 proc-macro2 = { workspace = true }
-proc-macro-error = "1.0"
+proc-macro-error2 = "2.0.1"
 quote = { workspace = true }
 strsim = "0.11"
 unic-langid = { workspace = true }
diff --git a/i18n-embed-fl/src/lib.rs b/i18n-embed-fl/src/lib.rs
index 2813eab..6598997 100644
--- a/i18n-embed-fl/src/lib.rs
+++ b/i18n-embed-fl/src/lib.rs
@@ -2,7 +2,7 @@ use fluent::{FluentAttribute, FluentMessage};
 use fluent_syntax::ast::{CallArguments, Expression, InlineExpression, Pattern, PatternElement};
 use i18n_embed::{fluent::FluentLanguageLoader, FileSystemAssets, LanguageLoader};
 use proc_macro::TokenStream;
-use proc_macro_error::{abort, emit_error, proc_macro_error};
+use proc_macro_error2::{abort, emit_error, proc_macro_error};
 use quote::quote;
 use std::{
     collections::{HashMap, HashSet},


Test patch: