-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[WIP] Make derive(Clone) memcpy on enum variants containing Copy types #47848
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
8beaf52
to
7725ee5
Compare
nowehere near ready for review, this was just me messing around. I might rewrite this to do something rather differently soon. |
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.
Will wait for further changes before properly reviewing, but we'll want somebody else besides me from the compiler team to look at it too.
@@ -1520,6 +1520,9 @@ pub enum AggregateKind<'tcx> { | |||
/// active field number and is present only for union expressions | |||
/// -- e.g. for a union expression `SomeUnion { c: .. }`, the | |||
/// active field index would identity the field `c` | |||
/// | |||
/// For enums, the second field is the index of the variant | |||
/// within AdtDef::fields | |||
Adt(&'tcx AdtDef, usize, &'tcx Substs<'tcx>, Option<usize>), |
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.
I wonder if we should start moving to struct-like variants for anything that has more than 3 fields throughout the compiler...
Yeah I'm going to get review from eddyb later. |
Superseded by #47867 |
fixes #47796