Uh oh!
There was an error while loading. Please reload this page.
Path fragments for drop obligations - #18234
Conversation
rust-highfive
commented
Oct 22, 2014
pnkfelix
commented
Oct 22, 2014
alexcrichton
commented
Nov 16, 2014
ping @pnkfelix |
pnkfelix
commented
Nov 17, 2014
@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 ... |
pnkfelix
commented
Nov 17, 2014
@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...) |
nikomatsakis
commented
Nov 17, 2014
@pnkfelix indeed I am doing that RIGHT NOW! |
nikomatsakis
commented
Nov 17, 2014
ok, r+ modulo the handling of |
nikomatsakis
commented
Nov 17, 2014
This is really nice, well documented. |
alexcrichton
commented
Nov 17, 2014
ah sorry didn't mean to annoy, just making sure the queue is moving! |
afc70f3 to
52ef4e4Compare52ef4e4 to
de78321Compare`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
5fbe0caCompare…-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.)
…Veykril internal: Filter out opaque tokens in some IDE feature macro descensions
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.)