-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Allow overruling forbidden lints in derive macros #81087
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
The job Click to see the possible cause of the failure (guessed by this bot)
|
c6523b7
to
21fba5d
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
That's not the cause of the failure, that's the failure itself. I'm the cause of the failure 😅 |
21fba5d
to
0981955
Compare
This is a pretty big divergence from how we are handling |
I've nominated #80988 on a similar question and included this question there, as well, but we might discuss them separately in T-lang. |
I agree that this is a t-lang level concern. |
It feels somewhat arbitrary to only do this for derive macros, and to not provide a way of opting out of this. While derive macros do have meaningful differences (the inability to modify the original tokens, and receiving their input after cfg stripping), they are not the only kind of macro used to generate code. For example, the If we want to provide macros with the ability to override |
Personally, I see this as part of the point of If you want to disallow something, but allow overriding that from within a macro, use So, either |
@scottmcm is posting some discussion of this to #80988 . Based on discussion in a lang team meeting, we're not in favor of supporting allow-after-forbid, in macros or otherwise. The consensus was that if you use However, we're open to other solutions, such as:
FCP-closing to confirm consensus. @rfcbot close |
Fixes #71898 by allowing derive expansions to override forbidden lints that are set outside the expansion.