Skip to content

Commit 308e30e

Browse files
committed
adding Visitor changes
1 parent 7d590b5 commit 308e30e

File tree

1 file changed

+23
-1
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+23
-1
lines changed

src/librustc_mir/borrow_check/mod.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc::hir::map::definitions::DefPathData;
1717
use rustc::infer::InferCtxt;
1818
use rustc::ty::{self, ParamEnv, TyCtxt};
1919
use rustc::ty::maps::Providers;
20-
use rustc::mir::{AssertMessage, BasicBlock, BorrowKind, Location, Place};
20+
use rustc::mir::{AssertMessage, BasicBlock, BorrowKind, Local, Location, Place, Visitor};
2121
use rustc::mir::{Mir, Mutability, Operand, Projection, ProjectionElem, Rvalue};
2222
use rustc::mir::{Field, Statement, StatementKind, Terminator, TerminatorKind};
2323
use rustc::mir::ClosureRegionRequirements;
@@ -56,6 +56,20 @@ mod prefixes;
5656

5757
use std::borrow::Cow;
5858

59+
struct FindLocalAssignmentVisitor {
60+
from: Local,
61+
loc: Vec<Location>,
62+
}
63+
64+
impl<'tcx> Visitor<'tcx> for FindLocalAssignmentVisitor {
65+
fn visit_local(&mut self,
66+
local: &mut Local,
67+
_: PlaceContext<'tcx>,
68+
_: Location) {
69+
Visitor::visit_local(local,)
70+
}
71+
}
72+
5973
pub(crate) mod nll;
6074

6175
pub fn provide(providers: &mut Providers) {
@@ -2271,3 +2285,11 @@ impl ContextKind {
22712285
}
22722286
}
22732287
}
2288+
2289+
impl Mir {
2290+
fn find_assignments(&self, local: Local) -> Vec<Location>
2291+
{
2292+
2293+
}
2294+
}
2295+

0 commit comments

Comments
 (0)