-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Feature-gate #[derive_*] even when produced by macro expansion. #32671
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
// FIXME(eddyb) #[allow_internal_unstable] | ||
// doesn't actually work for some reason. | ||
|
||
#[derive(Clone)] //#[derive_Clone] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't you need to also turn on the feature gate for #[derive_X]
syntax? Is there even such a gate? namely #![feature(custom_derive)]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is, custom_derive
, but allow_internal_unstable
is supposed to bypass the actual feature gating (i.e. any feature can be used inside an #[allow_internal_unstable]
macro).
This works with, e.g. #[thread_local] static FOO: usize = 0;
, but not #[derive_Clone]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nevermind then, I thought it looked at the actual features enabled in the macro-declaring crate.
☔ The latest upstream changes (presumably #32791) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes #32655 by marking
#[derive_Trait]
attributes produced by the compiler from theuser-friendly
#[derive(Trait)]
syntax to allow unstable features, and gating on that.