]> git.lizzy.rs Git - rust.git/commit
Pre-step towards issue #12624 and others: Introduce ExprUseVisitor, remove the
authorNiko Matsakis <niko@alum.mit.edu>
Mon, 21 Apr 2014 23:21:53 +0000 (19:21 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 24 Apr 2014 23:59:49 +0000 (19:59 -0400)
commit96dfed2b62c6e84a542f9a170133ec528e2191c2
tree858758be479d75ed97b70014ce19927fa750280a
parent77a975df85694a4de07abb5f99f1159799b1160d
Pre-step towards issue #12624 and others: Introduce ExprUseVisitor, remove the
moves computation. ExprUseVisitor is a visitor that walks the AST for a
function and calls a delegate to inform it where borrows, copies, and moves
occur.

In this patch, I rewrite the gather_loans visitor to use ExprUseVisitor, but in
future patches, I think we could rewrite regionck, check_loans, and possibly
other passes to use it as well. This would refactor the repeated code between
those places that tries to determine where copies/moves/etc occur.
27 files changed:
src/librustc/driver/driver.rs
src/librustc/lib.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/gather_loans/gather_moves.rs
src/librustc/middle/borrowck/gather_loans/lifetime.rs
src/librustc/middle/borrowck/gather_loans/mod.rs
src/librustc/middle/borrowck/gather_loans/move_error.rs
src/librustc/middle/borrowck/gather_loans/restrictions.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/borrowck/move_data.rs
src/librustc/middle/check_match.rs
src/librustc/middle/const_eval.rs
src/librustc/middle/expr_use_visitor.rs [new file with mode: 0644]
src/librustc/middle/freevars.rs
src/librustc/middle/kind.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/moves.rs [deleted file]
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/closure.rs
src/librustc/middle/trans/context.rs
src/librustc/middle/trans/inline.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/check/regionck.rs
src/libsyntax/ast_util.rs
src/test/compile-fail/moves-sru-moved-field.rs