Skip to content

Commit 92be4fc

Browse files
committed
Remove visit_user_type_projection from MIR traversal
This visitor method is unused, would visit each user-type projection multiple times, and interferes with changes to how user-type projections are stored.
1 parent c3fe9e7 commit 92be4fc

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

compiler/rustc_middle/src/mir/visit.rs

+2-21
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,6 @@ macro_rules! make_mir_visitor {
222222
self.super_ty(ty);
223223
}
224224

225-
fn visit_user_type_projection(
226-
&mut self,
227-
ty: & $($mutability)? UserTypeProjection,
228-
) {
229-
self.super_user_type_projection(ty);
230-
}
231-
232225
fn visit_user_type_annotation(
233226
&mut self,
234227
index: UserTypeAnnotationIndex,
@@ -818,14 +811,13 @@ macro_rules! make_mir_visitor {
818811
fn super_ascribe_user_ty(&mut self,
819812
place: & $($mutability)? Place<'tcx>,
820813
variance: $(& $mutability)? ty::Variance,
821-
user_ty: & $($mutability)? UserTypeProjection,
814+
_user_ty: & $($mutability)? UserTypeProjection,
822815
location: Location) {
823816
self.visit_place(
824817
place,
825818
PlaceContext::NonUse(NonUseContext::AscribeUserTy($(* &$mutability *)? variance)),
826819
location
827820
);
828-
self.visit_user_type_projection(user_ty);
829821
}
830822

831823
fn super_coverage(&mut self,
@@ -850,7 +842,7 @@ macro_rules! make_mir_visitor {
850842
let LocalDecl {
851843
mutability: _,
852844
ty,
853-
user_ty,
845+
user_ty: _,
854846
source_info,
855847
local_info: _,
856848
} = local_decl;
@@ -861,11 +853,6 @@ macro_rules! make_mir_visitor {
861853
local,
862854
source_info: *source_info,
863855
});
864-
if let Some(user_ty) = user_ty {
865-
for (user_ty, _) in & $($mutability)? user_ty.contents {
866-
self.visit_user_type_projection(user_ty);
867-
}
868-
}
869856
}
870857

871858
fn super_var_debug_info(
@@ -945,12 +932,6 @@ macro_rules! make_mir_visitor {
945932
self.visit_source_scope($(& $mutability)? *scope);
946933
}
947934

948-
fn super_user_type_projection(
949-
&mut self,
950-
_ty: & $($mutability)? UserTypeProjection,
951-
) {
952-
}
953-
954935
fn super_user_type_annotation(
955936
&mut self,
956937
_index: UserTypeAnnotationIndex,

0 commit comments

Comments
 (0)