|
1 | 1 | use hir::def_id::DefId; |
2 | | -use infer::canonical::Canonical; |
3 | 2 | use ty::subst::Substs; |
4 | | -use ty::{ClosureSubsts, GeneratorSubsts, Region, Ty}; |
| 3 | +use ty::{CanonicalUserTypeAnnotation, ClosureSubsts, GeneratorSubsts, Region, Ty}; |
5 | 4 | use mir::*; |
6 | 5 | use syntax_pos::Span; |
7 | 6 |
|
@@ -221,7 +220,7 @@ macro_rules! make_mir_visitor { |
221 | 220 | fn visit_user_type_annotation( |
222 | 221 | &mut self, |
223 | 222 | index: UserTypeAnnotationIndex, |
224 | | - ty: & $($mutability)* Canonical<'tcx, UserType<'tcx>>, |
| 223 | + ty: & $($mutability)* CanonicalUserTypeAnnotation<'tcx>, |
225 | 224 | ) { |
226 | 225 | self.super_user_type_annotation(index, ty); |
227 | 226 | } |
@@ -309,12 +308,15 @@ macro_rules! make_mir_visitor { |
309 | 308 | self.visit_local_decl(local, & $($mutability)* mir.local_decls[local]); |
310 | 309 | } |
311 | 310 |
|
312 | | - for index in mir.user_type_annotations.indices() { |
313 | | - let (span, annotation) = & $($mutability)* mir.user_type_annotations[index]; |
| 311 | + macro_rules! type_annotations { |
| 312 | + (mut) => (mir.user_type_annotations.iter_enumerated_mut()); |
| 313 | + () => (mir.user_type_annotations.iter_enumerated()); |
| 314 | + }; |
| 315 | + |
| 316 | + for (index, annotation) in type_annotations!($($mutability)*) { |
314 | 317 | self.visit_user_type_annotation( |
315 | 318 | index, annotation |
316 | 319 | ); |
317 | | - self.visit_span(span); |
318 | 320 | } |
319 | 321 |
|
320 | 322 | self.visit_span(&$($mutability)* mir.span); |
@@ -882,8 +884,9 @@ macro_rules! make_mir_visitor { |
882 | 884 | fn super_user_type_annotation( |
883 | 885 | &mut self, |
884 | 886 | _index: UserTypeAnnotationIndex, |
885 | | - _ty: & $($mutability)* Canonical<'tcx, UserType<'tcx>>, |
| 887 | + ty: & $($mutability)* CanonicalUserTypeAnnotation<'tcx>, |
886 | 888 | ) { |
| 889 | + self.visit_span(& $($mutability)* ty.span); |
887 | 890 | } |
888 | 891 |
|
889 | 892 | fn super_ty(&mut self, _ty: & $($mutability)* Ty<'tcx>) { |
|
0 commit comments