-
Notifications
You must be signed in to change notification settings - Fork 3
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
Difference in error message when switching from proc-macro-error #1
Comments
The only thing I can think to have caused this is that it is no longer doing hacky nightly detection to use the unstable Diagnostic API. If you enable the I am personally against automatic nightly detection as it causes huge headaches for everyone in the ecosystem as people can unknowingly be using unstable features when just using the nightly toolchain for other reasons. |
Using the nightly feature does the trick! $ diff -u without_nightly.log with_nightly.log
--- without_nightly.log 2024-09-06 16:41:20.185980525 -0700
+++ with_nightly.log 2024-09-06 16:39:56.254197678 -0700
@@ -1,13 +1,15 @@
Kani Rust Verifier 0.55.0 (standalone)
error: Cannot derive `Arbitrary` for `Wrapper` union
-
- = note: `#[derive(Arbitrary)]` cannot be used for unions such as `Wrapper`
-
--> union.rs:5:10
|
5 | #[derive(kani::Arbitrary)]
| ^^^^^^^^^^^^^^^
|
+note: `#[derive(Arbitrary)]` cannot be used for unions such as `Wrapper`
+ --> union.rs:6:7
+ |
+6 | union Wrapper {
+ | ^^^^^^^
= note: this error originates in the derive macro `kani::Arbitrary` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 1 previous error Thanks! I'll close this issue. |
As suggested in GnomedDev/proc-macro-error-2#1 (comment), turning on the `nightly` feature for `proc-macro-error2` to restore the previous error message for `derive(Arbitrary)`. Resolves #3495 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
Thank you for creating this fork of
proc-macro-error
. We've switched toproc-macro-error2
in model-checking/kani#3493, but we observed a difference in the emitted error.With
proc-macro-error
, the error was:With
proc-macro-error2
, the error is:The two notable differences are:
union Wrapper
) is no longer included in the errornote
does not appear after the span.Is the difference expected?
This is the code that emits the error:
https://github.com/model-checking/kani/blob/701f6fb8e26acf0c31f053cc1503a4139b277e29/library/kani_macros/src/derive.rs#L89
The text was updated successfully, but these errors were encountered: