Skip to content

rustc: Implement the Drop trait - #3925

Closed
pcwalton wants to merge 1 commit into
rust-lang:incomingfrom
pcwalton:drop-trait
Closed

rustc: Implement the Drop trait#3925
pcwalton wants to merge 1 commit into
rust-lang:incomingfrom
pcwalton:drop-trait

Conversation

@pcwalton

Copy link
Copy Markdown
Contributor

@brson

brson commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

@jruderman The plan is to remove drop for 0.5, so all the existing tests will get converted to the trait. With that in mind, the test coverage here looks very good to me. Two things that I can think of that aren't covered here are parameterizing over the Drop trait and using it as an object - these things probably work fine, but Drop is special, and these are scenarios that real code will rarely use, so regression tests might be appropriate.

I'm also curious about how trait/impl visibility works, and how that releates to Drop.

@brson

brson commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

r+

@pcwalton

Copy link
Copy Markdown
ContributorAuthor

It raises annoying issues about where to place the drop flag, and I didn't want to put too much in this patch.

@nikomatsakis

Copy link
Copy Markdown
Contributor

Regarding enums, that's fine. It seems like we can (eventually) treat them the same we treat structs. That is, we translate a struct Foo { ... } to { {...} }. If there is a drop implementation, it becomes { {...}, flag }. Presumably we can wrap enums in an extra struct layer in the same way. This means that you can access fields or contents without caring about whether there is a destructor or not.

@pcwaltonpcwalton closed this Nov 7, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Sep 29, 2024
skip old getrandom crate on Solaris
Fixesrust-lang/miri#3924
Now we should be able to enable randomness tests on Solarish (and Android, while we are at it).
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
3925: Implement assist "Reorder field names" r=matklad a=geoffreycopin
This PR implements the "Reorder record fields" assist as discussed in issue rust-lang#3821 .
Adding a `RecordFieldPat` variant to the `Pat` enum seemed like the easiest way to handle the `RecordPat` children as a single sequence of elements, maybe there is a better way ?
Co-authored-by: Geoffrey Copin <copin.geoffrey@gmail.com>
Sign up for freeto 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.

5 participants

@pcwalton@brson@nikomatsakis@graydon@jruderman