Drop unmaintained proc-macro-error2 - #3
Open
qmonnet wants to merge 5 commits into
Open
Conversation
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>
There was a problem hiding this comment.
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-error2withproc-macro-error3and adjusted crate usage accordingly. - Updated
synfeatures 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.
Make struct name consistent with macro usage. Reported by Copilot. Signed-off-by: Quentin Monnet <qmo@qmon.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Fixes: #2