Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

Manishearth
Copy link
Member

fixes #47796

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

@Manishearth
Copy link
Member Author

nowehere near ready for review, this was just me messing around. I might rewrite this to do something rather differently soon.

Copy link
Contributor

@estebank estebank left a 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>),
Copy link
Contributor

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...

@Manishearth
Copy link
Member Author

Yeah I'm going to get review from eddyb later.

@Manishearth
Copy link
Member Author

Superseded by #47867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

derived Clone implementations for many-variant enums are unnecessarily large
3 participants