Path fragments for drop obligations#18234
Merged
bors merged 10 commits intorust-lang:masterfrom Nov 25, 2014
Merged
Conversation
Contributor
Contributor
Author
Member
|
ping @pnkfelix |
Contributor
Author
|
@alexcrichton was that an implied request for me to rebase my PR based on @nikomatsakis 's feedback so far? I note that it seems like he is going through the commits (rather than the diff), so I would assume it might be better for me to wait until he is done with the initial review ... |
Contributor
Author
|
@alexcrichton (oh, in case its not clear, @nikomatsakis has already noted to me in several priv msg's that he is intending to return to this review...) |
Contributor
|
@pnkfelix indeed I am doing that RIGHT NOW! |
Contributor
|
ok, r+ modulo the handling of |
Contributor
|
This is really nice, well documented. |
Member
|
ah sorry didn't mean to annoy, just making sure the queue is moving! |
afc70f3 to
52ef4e4
Compare
52ef4e4 to
de78321
Compare
`LpDowncast` carries the `DefId` of the variant itself. To support this, added the enum variant `DefId` to the `cat_downcast` variant in `mem_categorization::categorization`. (updated to fix mem_categorization to handle downcast of enum struct-variants properly.)
To make this clean, refactored old `LoanPath` enum into a `LoanPath` struct with a `ty::t` and a newly-added `LoanPathVariant` enum. This enabled me to get rid of the ugly and fragile `LoanPath::to_type` method, and I can probably also get rid of other stuff that was supporting it, maybe.
… val now. This is to fix a problem where I could not reliably map attach the type for each loan-path to the loan-path itself because the same loan-path was ending up associated with two different types, because the cmt's had diverged in their interpretation of the path.
This is accomplished by: 1. Add `MatchMode` enum to `expr_use_visitor`. 2. Computing the match mode for each pattern via a pre-pass, and then passing the mode along when visiting the pattern in expr_use_visitor. 3. Adding a `fn matched_pat` callback to expr_use_visitor, which is called on interior struct and enum nodes of the pattern (as opposed to `fn consume_pat`, which is only invoked for identifiers at the leaves of the pattern), and invoking it accordingly. Of particular interest are the `cat_downcast` instances established when matching enum variants.
Includes differentiation between assigned_fragments and moved_fragments, support for all-but-one array fragments, and instrumentation to print out the moved/assigned/unmmoved/parents for each function, factored out into separate submodule.
The tests use new "//~| ERROR" follow syntax. Includes a test for moves involving array elements. It was easier than i realized to get something naive off the ground here.
de78321 to
5fbe0ca
Compare
bors
added a commit
that referenced
this pull request
Nov 25, 2014
…-2, r=nikomatsakis Code to fragment paths into pieces based on subparts being moved around, e.g. moving `x.1` out of a tuple `(A,B,C)` leaves behind the fragments `x.0: A` and `x.2: C`. Further discussion in borrowck/doc.rs. Includes differentiation between assigned_fragments and moved_fragments, support for all-but-one array fragments, and instrumentation to print out the moved/assigned/unmmoved/parents for each function, factored out into a separate submodule. These fragments can then be used by `trans` to inject stack-local dynamic drop flags. (They also can be hooked up with dataflow to reduce the expected number of injected flags.)
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
Oct 8, 2024
…Veykril internal: Filter out opaque tokens in some IDE feature macro descensions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code to fragment paths into pieces based on subparts being moved around, e.g. moving
x.1out of a tuple(A,B,C)leaves behind the fragmentsx.0: Aandx.2: C. Further discussion in borrowck/doc.rs.Includes differentiation between assigned_fragments and moved_fragments, support for all-but-one array fragments, and instrumentation to print out the moved/assigned/unmmoved/parents for each function, factored out into a separate submodule.
These fragments can then be used by
transto inject stack-local dynamic drop flags. (They also can be hooked up with dataflow to reduce the expected number of injected flags.)