Skip to content

Drop unmaintained proc-macro-error2 - #3

Open
qmonnet wants to merge 5 commits into
mainfrom
pr/qmonnet/misc
Open

Drop unmaintained proc-macro-error2#3
qmonnet wants to merge 5 commits into
mainfrom
pr/qmonnet/misc

Conversation

@qmonnet

@qmonnet qmonnet commented Aug 3, 2026

Copy link
Copy Markdown
Member

I find warnings about proc-macro-error2 annoying in the dataplane repository; we pull the crate for multi_index_map_derive, and here for fixin. We can at least move to an alternative for fixin.

This PR:

  • Switches to another dependency instead of proc-macro-error2,
  • Fixes the standalone build for the crate (and Clippy warnings),
  • Adds a basic CI workflow, to make sure the crate builds correctly on new PRs.

Fixes: #2

qmonnet and others added 4 commits August 4, 2026 00:26
The crate does not build locally with "cargo build", because some
features for the "syn" dependencies are missing. In dataplane, which
uses fixin for tests, we compile with multiple other crates relying on
the same version of "syn": tracing-attributes, pin-project-internal,
futures-macro, educe, derive_more-impl, ... Crate tracing-attributes
alone turns on features "full", "printing" and "clone-impls", making the
build pass.

Add missing features to ensure we do standalone builds for the crate.

Fixes: 5e0de31 ("Merge pull request #1 from githedgehog/pr/daniel-noland/bump")
Signed-off-by: Quentin Monnet <qmo@qmon.net>
Clippy warns that snippets with #[test] in docs will not run:

    $ cargo clippy
        Checking fixin v0.0.1 (/var/home/qmo/dev/fixin)
    warning: unit tests in doctest are not executed
      --> src/lib.rs:12:5
       |
    12 | //! #[test]
       |     ^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#test_attr_in_doctest
       = note: `#[warn(clippy::test_attr_in_doctest)]` on by default

    warning: unit tests in doctest are not executed
      --> src/lib.rs:23:5
       |
    23 | //! #[test]
       |     ^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#test_attr_in_doctest

    warning: `fixin` (lib) generated 2 warnings

We don't want to run these anyway, but we comment on the #[test]
attribute. Let's just silence this Clippy warning in the file.

Signed-off-by: Quentin Monnet <qmo@qmon.net>
Build, test, run Clippy and formatter on PRs.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Quentin Monnet <qmo@qmon.net>
Crate proc-macro-error2 is no longer maintained, and causes warnings in
downstream projects. The related RUSTSEC advisory mentions "manyhow" and
"proc-macro2-diagnostics" as possible alternatives, but they require
some code adjustments. Although less popular, proc-macro-error3 is a
drop-in replacement, currently maintained.

Link: https://rustsec.org/advisories/RUSTSEC-2026-0173
Signed-off-by: Quentin Monnet <qmo@qmon.net>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the unmaintained proc-macro-error2 dependency from the fixin proc-macro crate by switching to a maintained alternative, and adds CI to ensure the crate continues to build and pass checks going forward.

Changes:

  • Replaced proc-macro-error2 with proc-macro-error3 and adjusted crate usage accordingly.
  • Updated syn features to support standalone builds and reduce related warnings.
  • Added a GitHub Actions workflow to run fmt, clippy, build, and tests on PRs and main.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/lib.rs Switches the proc-macro error attribute macro and tweaks crate-level clippy configuration.
Cargo.toml Updates dependencies (proc-macro-error3) and expands syn feature set for standalone builds.
Cargo.lock Lockfile updates reflecting dependency switch to proc-macro-error3.
.github/workflows/build.yml Adds CI workflow for formatting, clippy, build, and tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib.rs
Comment thread Cargo.toml
Make struct name consistent with macro usage.

Reported by Copilot.

Signed-off-by: Quentin Monnet <qmo@qmon.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unmaintained dependency: proc-macro-error2

2 participants