Skip to content

Commit d84018b

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 6d3c050 commit d84018b

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

compiler/rustc_middle/src/mir/visit.rs

+4-19
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,
@@ -804,17 +797,16 @@ macro_rules! make_mir_visitor {
804797
&mut self,
805798
place: & $($mutability)? Place<'tcx>,
806799
variance: $(& $mutability)? ty::Variance,
807-
user_ty: & $($mutability)? UserTypeProjection,
808-
location: Location)
809-
{
800+
_user_ty: & $($mutability)? UserTypeProjection,
801+
location: Location,
802+
) {
810803
self.visit_place(
811804
place,
812805
PlaceContext::NonUse(
813806
NonUseContext::AscribeUserTy($(* &$mutability *)? variance)
814807
),
815808
location
816809
);
817-
self.visit_user_type_projection(user_ty);
818810
}
819811

820812
fn super_coverage(
@@ -845,7 +837,7 @@ macro_rules! make_mir_visitor {
845837
let LocalDecl {
846838
mutability: _,
847839
ty,
848-
user_ty,
840+
user_ty: _,
849841
source_info,
850842
local_info: _,
851843
} = local_decl;
@@ -856,11 +848,6 @@ macro_rules! make_mir_visitor {
856848
local,
857849
source_info: *source_info,
858850
});
859-
if let Some(user_ty) = user_ty {
860-
for (user_ty, _) in & $($mutability)? user_ty.contents {
861-
self.visit_user_type_projection(user_ty);
862-
}
863-
}
864851
}
865852

866853
fn super_local(
@@ -947,8 +934,6 @@ macro_rules! make_mir_visitor {
947934
self.visit_source_scope($(& $mutability)? *scope);
948935
}
949936

950-
fn super_user_type_projection(&mut self, _ty: & $($mutability)? UserTypeProjection) {}
951-
952937
fn super_user_type_annotation(
953938
&mut self,
954939
_index: UserTypeAnnotationIndex,

0 commit comments

Comments
 (0)