Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for `custom_derive` feature #29644
Comments
aturon
added
T-lang
B-unstable
labels
Nov 5, 2015
This comment has been minimized.
This comment has been minimized.
|
There isn't really much incentive to stabilize this at the moment; this is basically only useful with plugins (and syntex, but the gate doesn't affect that usage). |
pnkfelix
referenced this issue
Mar 31, 2016
Closed
Macro expansion bypasses #[derive_*] stability checks. #32655
This comment has been minimized.
This comment has been minimized.
|
Is there an RFC for this? I couldn't find one easily. |
This comment has been minimized.
This comment has been minimized.
|
No RFC; see #23137. |
This comment has been minimized.
This comment has been minimized.
|
Do we know who uses custom_derive? It seems like a horrible hack. (Thanks for the link @eefriedman) |
This comment has been minimized.
This comment has been minimized.
|
wow look at the turnaround time on that PR! Proposed, r+'ed, and landed all in one day! |
This comment has been minimized.
This comment has been minimized.
|
Two crates that use custom_derive: serde_macros and diesel_codegen. |
This comment has been minimized.
This comment has been minimized.
|
Servo also uses it in a few places, for example https://github.com/servo/heapsize . |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the info. I think custom derive is something we should support, but not in the current form. I'll have a think about how it fits in to the procedural macro overhaul and write some kind of RFC. |
callahad
added a commit
to callahad/ladaemon
that referenced
this issue
Jun 24, 2016
callahad
added a commit
to callahad/ladaemon
that referenced
this issue
Jun 26, 2016
This comment has been minimized.
This comment has been minimized.
e-oz
commented
Jun 29, 2016
|
HOPE WILL NEVER DIE! Can't use XML/JSON deserialization to structures, but I still hope... |
This comment has been minimized.
This comment has been minimized.
|
cc #35900 |
This comment has been minimized.
This comment has been minimized.
|
Nominating for deprecation now that we have macros 1.1 custom derive in place. |
nrc
added
the
I-nominated
label
Sep 27, 2016
nikomatsakis
added
final-comment-period
and removed
I-nominated
labels
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
@rfcbot fcp close The general consensus is that this is subsumed by macros 1.1, which offers a more general solution. |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Oct 5, 2016
•
|
Team member nikomatsakis has proposed to close this. The next step is review by the rest of the tagged teams: No concerns currently listed. See this document for info about what commands tagged team members can give me. |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Oct 22, 2016
|
All relevant subteam members have reviewed. No concerns remain. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Nov 1, 2016
|
The final comment period is now complete. |
brson
removed
the
final-comment-period
label
Jan 11, 2017
This comment has been minimized.
This comment has been minimized.
|
This is waiting on ultimate removal. Note that here @SergioBenitez says Rocket needs this feature. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I'm in favour of a longer than usual deprecation period. As well as being more powerful, people apparently continue to use old custom derive because they can have a single crate which implements both derives and proc macros, and until we have a more function proc macro 2.0 solution, using new custom derive means having two separate implementations. |
This comment has been minimized.
This comment has been minimized.
|
Please see my argument against removal in #37128 (comment). I'm okay with deprecation as long as #38533 remains valid (users don't receive a warning) and I can |
This comment has been minimized.
This comment has been minimized.
joshhansen
commented
Jan 21, 2017
|
I'm confused about the status of this deprecation. The nightly compiler says derive for custom traits will be removed in 1.15, but nightly is now in 1.16. Combined with @SergioBenitez's comments and Rocket's continued dependence on this feature, I'm pretty unsure whether to assume it will continue for the foreseeable future or whether it really is at risk of being removed any time now. Please advise. |
This comment has been minimized.
This comment has been minimized.
|
The deprecation warning was written many months ago, given the above comments the warning should probably be bumped a few versions. |
This was referenced Jan 24, 2017
This comment has been minimized.
This comment has been minimized.
|
So regarding the deprecation warning, what will the next removal target be? 1.17 + 3 = 1.20 perhaps? |
This comment has been minimized.
This comment has been minimized.
|
@joshhansen My feeling is that we should remove this and I would definitely not advise writing new code that relies on it. That said, I don't think there is a tremendous hurry to do so; all things being equal I'd prefer not to break rocket, of course. Still, if this feature ever becomes an obstacle to doing something we would want, I would be inclined to remove it ASAP, so migrating is definitely a good idea. I heard something about @jseyfried working with @SergioBenitez to move over to the prototypes of the newer macro system that may be relevant here. |
This comment has been minimized.
This comment has been minimized.
e-oz
commented
Feb 2, 2017
|
I feel absolutely confused. You just announced it here: https://blog.rust-lang.org/2017/02/02/Rust-1.15.html |
This comment has been minimized.
This comment has been minimized.
|
@e-oz We just stabilized and announced a different feature (macros 1.1, aka |
This comment has been minimized.
This comment has been minimized.
e-oz
commented
Feb 2, 2017
|
I have to say it was awful idea to release new feature with exactly same name as old deprecated feature. |
This comment has been minimized.
This comment has been minimized.
|
The name of the new feature was |
This comment has been minimized.
This comment has been minimized.
|
Of course, in retrospect it would have been better to name the old feature something more specific than |
This comment has been minimized.
This comment has been minimized.
|
I think the complaint was about the release announcement, which said we're stabilizing "custom derive". I agree that this is all a bit confusing, especially for those not following Rust development closely. |
This comment has been minimized.
This comment has been minimized.
e-oz
commented
Feb 2, 2017
|
Yes, that's what broke my whole app and gave me work for a couple of next days. |
bors
added a commit
that referenced
this issue
Feb 4, 2017
bors
added a commit
that referenced
this issue
Feb 6, 2017
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
|
@SergioBenitez Are you still using this feature? |
This comment has been minimized.
This comment has been minimized.
|
@cramertj Yes. With the recent improvements to the proc_macro APIs and a few additional ones, however, I should be able to move Rocket to proc_macro soon. |
This comment has been minimized.
This comment has been minimized.
|
@SergioBenitez are you still using this feature? |
This comment has been minimized.
This comment has been minimized.
|
Yes. The plan is to migrate away from custom_derive as soon as possible however. Current progress puts us as doing so by next release, or about a month. |
petrochenkov
referenced this issue
Sep 16, 2018
Merged
Unsupport `#[derive(Trait)]` sugar for `#[derive_Trait]` legacy plugin attributes #54271
This comment has been minimized.
This comment has been minimized.
|
Update: All of Rocket's derives are now implemented as proc-macros and will ship as such in the next official release, which should be within a couple of weeks time. |
aturon commentedNov 5, 2015
Treats
#[derive(Anything)]like#[derive_Anything]. Tracking for stabilization.