Repository: qryxip/cargo-equip (language: rust)

Issue:
cargo-equip Incompatible minify results with Rust 2021
- https://github.com/qryxip/rustminify/issues/6
- https://github.com/qryxip/rustminify/pull/7

https://doc.rust-lang.org/reference/tokens.html#reserved-prefixes
> **Edition Differences**: Starting with the 2021 edition, reserved prefixes are reported as an error by the lexer (in particular, they cannot be passed to macros).
>
> Before the 2021 edition, reserved prefixes are accepted by the lexer and interpreted as multiple tokens (for example, one token for the identifier or keyword, followed by a `#` token).
>
> Examples accepted in all editions:
> ```rust
> macro_rules! lexes {($($_:tt)*) => {}}
> lexes!{a #foo}
> lexes!{continue 'foo}
> lexes!{match "..." {}}
> lexes!{r#let#foo}         // three tokens: r#let # foo
> ```
>
> Examples accepted before the 2021 edition but rejected later:
> ```rust,edition2018
> macro_rules! lexes {($($_:tt)*) => {}}
> lexes!{a#foo}
> lexes!{continue'foo}
> lexes!{match"..." {}}
> ```



Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4bbf999..0d01aad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -54,6 +54,10 @@
 
     Now cargo-equip built with recent Rust works.
 
+- Adapted [the new reserving syntax in Rust 2021](https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html) when minifying. ([qryxip/rustminify#7](https://github.com/qryxip/rustminify/pull/7) by [@mizar](https://github.com/mizar)).
+
+    This fix affects Rust 2018. The output might be few characters longer.
+
 ## [0.19.0] - 2022-03-26Z
 
 ### Added
diff --git a/Cargo.lock b/Cargo.lock
index 021d331..ad03ad6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1144,9 +1144,9 @@ dependencies = [
 
 [[package]]
 name = "rustminify"
-version = "0.1.0"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ebf2755dbb7825d6215fa58eb885419385d62d29a5bba66eda6dce2655043d9"
+checksum = "2cd48802ac21406f1324dd919bad11157662eaafeb449011d50bd7cbab889762"
 dependencies = [
  "proc-macro2",
  "quote",
diff --git a/Cargo.toml b/Cargo.toml
index 10b36eb..10d3bee 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,7 +31,7 @@ ra_ap_paths = "=0.0.166"
 ra_ap_proc_macro_api = "=0.0.166"
 ra_ap_tt = "=0.0.166"
 rand = "0.8.5"
-rustminify = "0.1.0"
+rustminify = "0.2.0"
 semver = { version = "1.0.18", features = ["serde"] }
 serde = { version = "1.0.181", features = ["derive"] }
 serde_json = "1.0.104"


Test patch: