|
10 | 10 |
|
11 | 11 | use rustc::ty::subst::Substs;
|
12 | 12 | use rustc::ty::{self, CanonicalTy, ClosureSubsts, GeneratorSubsts, Ty, TypeFoldable};
|
13 |
| -use rustc::mir::{BasicBlock, Location, Mir, Place, Statement, StatementKind}; |
| 13 | +use rustc::mir::{BasicBlock, Location, Mir, Statement, StatementKind}; |
14 | 14 | use rustc::mir::visit::{MutVisitor, TyContext};
|
15 | 15 | use rustc::infer::{InferCtxt, NLLRegionVariableOrigin};
|
16 | 16 |
|
@@ -65,6 +65,14 @@ impl<'a, 'gcx, 'tcx> MutVisitor<'tcx> for NLLVisitor<'a, 'gcx, 'tcx> {
|
65 | 65 | debug!("visit_ty: ty={:?}", ty);
|
66 | 66 | }
|
67 | 67 |
|
| 68 | + fn visit_user_ty(&mut self, _ty: &mut CanonicalTy<'tcx>) { |
| 69 | + // `user_ty` annotations represent the types that the user |
| 70 | + // wrote in the progarm. We don't want to erase the regions |
| 71 | + // from these types: rather, we want to add them as |
| 72 | + // constraints at type-check time. |
| 73 | + debug!("visit_user_ty: skipping renumber"); |
| 74 | + } |
| 75 | + |
68 | 76 | fn visit_substs(&mut self, substs: &mut &'tcx Substs<'tcx>, location: Location) {
|
69 | 77 | debug!("visit_substs(substs={:?}, location={:?})", substs, location);
|
70 | 78 |
|
@@ -112,19 +120,6 @@ impl<'a, 'gcx, 'tcx> MutVisitor<'tcx> for NLLVisitor<'a, 'gcx, 'tcx> {
|
112 | 120 | debug!("visit_closure_substs: substs={:?}", substs);
|
113 | 121 | }
|
114 | 122 |
|
115 |
| - fn visit_ascribe_user_ty( |
116 |
| - &mut self, |
117 |
| - _place: &mut Place<'tcx>, |
118 |
| - _variance: &mut ty::Variance, |
119 |
| - _c_ty: &mut CanonicalTy<'tcx>, |
120 |
| - _location: Location, |
121 |
| - ) { |
122 |
| - // User-assert-ty statements represent types that the user added explicitly. |
123 |
| - // We don't want to erase the regions from these types: rather, we want to |
124 |
| - // add them as constraints at type-check time. |
125 |
| - debug!("visit_user_assert_ty: skipping renumber"); |
126 |
| - } |
127 |
| - |
128 | 123 | fn visit_statement(
|
129 | 124 | &mut self,
|
130 | 125 | block: BasicBlock,
|
|
0 commit comments