@@ -780,6 +780,35 @@ impl LowerPolarity for Polarity {
780
780
}
781
781
}
782
782
783
+ trait LowerImplType {
784
+ fn lower ( & self ) -> rust_ir:: ImplType ;
785
+ }
786
+
787
+ impl LowerImplType for ImplType {
788
+ fn lower ( & self ) -> rust_ir:: ImplType {
789
+ match self {
790
+ ImplType :: Local => rust_ir:: ImplType :: Local ,
791
+ ImplType :: External => rust_ir:: ImplType :: External ,
792
+ }
793
+ }
794
+ }
795
+
796
+ trait LowerTraitFlags {
797
+ fn lower ( & self ) -> rust_ir:: TraitFlags ;
798
+ }
799
+
800
+ impl LowerTraitFlags for TraitFlags {
801
+ fn lower ( & self ) -> rust_ir:: TraitFlags {
802
+ rust_ir:: TraitFlags {
803
+ auto : self . auto ,
804
+ marker : self . marker ,
805
+ upstream : self . upstream ,
806
+ fundamental : self . fundamental ,
807
+ non_enumerable : self . non_enumerable ,
808
+ }
809
+ }
810
+ }
811
+
783
812
trait LowerProjectionTy {
784
813
fn lower ( & self , env : & Env ) -> Fallible < chalk_ir:: ProjectionTy > ;
785
814
}
@@ -966,10 +995,7 @@ impl LowerImpl for Impl {
966
995
Ok ( rust_ir:: ImplDatum {
967
996
polarity,
968
997
binders : binders,
969
- impl_type : match self . impl_type {
970
- ImplType :: Local => rust_ir:: ImplType :: Local ,
971
- ImplType :: External => rust_ir:: ImplType :: External ,
972
- } ,
998
+ impl_type : self . impl_type . lower ( ) ,
973
999
} )
974
1000
}
975
1001
}
@@ -1086,13 +1112,7 @@ impl LowerTrait for TraitDefn {
1086
1112
1087
1113
Ok ( rust_ir:: TraitDatum {
1088
1114
binders : binders,
1089
- flags : rust_ir:: TraitFlags {
1090
- auto : self . flags . auto ,
1091
- marker : self . flags . marker ,
1092
- upstream : self . flags . upstream ,
1093
- fundamental : self . flags . fundamental ,
1094
- non_enumerable : self . flags . non_enumerable ,
1095
- } ,
1115
+ flags : self . flags . lower ( ) ,
1096
1116
} )
1097
1117
}
1098
1118
}
0 commit comments