Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap to Proc Macro Error 2 RUSTSEC-2024-0370 #350

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pvichivanives
Copy link

Hi!
Given the RUSTSEC warning issued here: https://rustsec.org/advisories/RUSTSEC-2024-0370 just submitting a PR to move to the reccomended new version of procmacroerror2
image

@jayvdb
Copy link

jayvdb commented Sep 8, 2024

Please run the tests with TRYBUILD=overwrite set.

@jayvdb
Copy link

jayvdb commented Sep 11, 2024

ping @Keats

@pvichivanives
Copy link
Author

pvichivanives commented Sep 12, 2024

Apparently the error messages between 1.79 and 1.81 are different. I've pushed the error messages for 1.79 since it seems thats what the CI test was failing on fist. However, one will always fail. This is true on the master branch as well.

darling = { version = "0.20", features = ["suggestions"] }
once_cell = "1.18.0"

[features]
nightly = ["proc-macro-error2/nightly"]
Copy link
Owner

Choose a reason for hiding this comment

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

can the name be more clear somehow?

Copy link
Author

Choose a reason for hiding this comment

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

nightly_features?

Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure, I don't even know what this does in proc-macro-error2

Copy link
Author

@pvichivanives pvichivanives Sep 19, 2024

Choose a reason for hiding this comment

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

For the nightly feature in proc-macro-error2 its just a different implementation for emitting diagnostics and aborting. The main difference between the two appear to be that warnings are emitted in nightly while ignored in non-nightly builds. Tagging @HigherOrderLogic since they requested this.

I also think its fine if the feature isn't included since Validator might not want to use these extra warnings anyway. Might be a good idea to move this to a different PR for another discussion.

If you want to look at the code its here: https://github.com/GnomedDev/proc-macro-error-2/tree/master/src/imp
The delegate.rs is the nightly version and fallback.rs is the non nightly version

Choose a reason for hiding this comment

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

I'm not sure, I don't even know what this does in proc-macro-error2

It's as @pvichivanives said, this feature enables emitting warning when using nightly compiler, otherwise ignored.

So to match the function, I think this feature can be renamed to nightly-warnning, or nightly-proc-macro, or even the longer nightly-proc-macro-error

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.

4 participants