-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
The error message for trying to derive an unsafe trait impl doesn't mention the trait name #33571
Comments
We just need to split this function into two (so it knows whether it's |
This is actually a regression. Playpen. On stable and beta the error spans point to the trait names, but on nightly ( |
Hmm. This is definitely a regression, but I'm not sure whether it's necessarily related to the new error messages (I can't think how that change would have caused this). I wonder if there were any changes to the deriving code tweaking the spans that it is using? Have to dig into it. |
Using a nightly before the new error format landed gives me this:
So it's likely a change between the beta and the nightly before we added the new errors. |
cc @LeoTestard could this have been caused by your changes related to stability? I suppose it might have been caused my PR for pattern matching, thought I don't think I changed any spans there. |
@nikomatsakis Hmm, possible. I'll look at it more deeply. |
Indeed it looks like it's caused by the fact that #[derive_*] attributes are now emitted with a special span so that the expansion functions for them knows if they have been generated by the expansion of a trusted attribute or if they have been written explicitly by the programmer (which is forbidden). I see three possiblities to fix that now:
|
Fix the span of generated `#[derive_*]` attributes Fixes rust-lang#33571. r? @nrc
I tried to derive every possible trait on an enum and received this error:
which isn't as helpful as it could be because it doesn't tell me which of the traits is the one it's complaining about.
The text was updated successfully, but these errors were encountered: