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.
Showing
此差异已折叠。
src/librustc/middle/moves.rs
已删除
100644 → 0
此差异已折叠。
想要评论请 注册 或 登录