@@ -160,7 +160,7 @@ pub enum ValuePairs<'tcx> {
160
160
/// encounter an error or subtyping constraint.
161
161
///
162
162
/// See `error_reporting.rs` for more details.
163
- #[ derive( Clone , Debug ) ]
163
+ #[ derive( Clone ) ]
164
164
pub struct TypeTrace < ' tcx > {
165
165
origin : TypeOrigin ,
166
166
values : ValuePairs < ' tcx > ,
@@ -708,7 +708,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
708
708
value : & ty:: Binder < T > ,
709
709
snapshot : & CombinedSnapshot )
710
710
-> ( T , SkolemizationMap )
711
- where T : TypeFoldable < ' tcx > + Repr
711
+ where T : TypeFoldable < ' tcx >
712
712
{
713
713
/*! See `higher_ranked::skolemize_late_bound_regions` */
714
714
@@ -733,7 +733,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
733
733
snapshot : & CombinedSnapshot ,
734
734
value : & T )
735
735
-> T
736
- where T : TypeFoldable < ' tcx > + Repr
736
+ where T : TypeFoldable < ' tcx >
737
737
{
738
738
/*! See `higher_ranked::plug_leaks` */
739
739
@@ -979,7 +979,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
979
979
Some ( t) if ty:: type_is_error ( t) => ( ) ,
980
980
_ => {
981
981
let error_str = err. map_or ( "" . to_string ( ) , |t_err| {
982
- format ! ( " ({})" , ty :: type_err_to_str ( self . tcx , t_err) )
982
+ format ! ( " ({})" , t_err)
983
983
} ) ;
984
984
985
985
self . tcx . sess . span_err ( sp, & format ! ( "{}{}" ,
@@ -1033,7 +1033,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1033
1033
lbrct : LateBoundRegionConversionTime ,
1034
1034
value : & ty:: Binder < T > )
1035
1035
-> ( T , FnvHashMap < ty:: BoundRegion , ty:: Region > )
1036
- where T : TypeFoldable < ' tcx > + Repr
1036
+ where T : TypeFoldable < ' tcx >
1037
1037
{
1038
1038
ty_fold:: replace_late_bound_regions (
1039
1039
self . tcx ,
@@ -1099,9 +1099,9 @@ impl<'tcx> TypeTrace<'tcx> {
1099
1099
}
1100
1100
}
1101
1101
1102
- impl < ' tcx > Repr for TypeTrace < ' tcx > {
1103
- fn repr ( & self ) -> String {
1104
- format ! ( "TypeTrace({})" , self . origin. repr ( ) )
1102
+ impl < ' tcx > fmt :: Debug for TypeTrace < ' tcx > {
1103
+ fn fmt ( & self , f : & mut fmt :: Formatter ) -> fmt :: Result {
1104
+ write ! ( f , "TypeTrace({:? })" , self . origin)
1105
1105
}
1106
1106
}
1107
1107
@@ -1123,44 +1123,6 @@ impl TypeOrigin {
1123
1123
}
1124
1124
}
1125
1125
1126
- impl < ' tcx > Repr for TypeOrigin {
1127
- fn repr ( & self ) -> String {
1128
- match * self {
1129
- MethodCompatCheck ( a) => {
1130
- format ! ( "MethodCompatCheck({})" , a. repr( ) )
1131
- }
1132
- ExprAssignable ( a) => {
1133
- format ! ( "ExprAssignable({})" , a. repr( ) )
1134
- }
1135
- Misc ( a) => format ! ( "Misc({})" , a. repr( ) ) ,
1136
- RelateTraitRefs ( a) => {
1137
- format ! ( "RelateTraitRefs({})" , a. repr( ) )
1138
- }
1139
- RelateSelfType ( a) => {
1140
- format ! ( "RelateSelfType({})" , a. repr( ) )
1141
- }
1142
- RelateOutputImplTypes ( a) => {
1143
- format ! ( "RelateOutputImplTypes({})" , a. repr( ) )
1144
- }
1145
- MatchExpressionArm ( a, b) => {
1146
- format ! ( "MatchExpressionArm({}, {})" , a. repr( ) , b. repr( ) )
1147
- }
1148
- IfExpression ( a) => {
1149
- format ! ( "IfExpression({})" , a. repr( ) )
1150
- }
1151
- IfExpressionWithNoElse ( a) => {
1152
- format ! ( "IfExpressionWithNoElse({})" , a. repr( ) )
1153
- }
1154
- RangeExpression ( a) => {
1155
- format ! ( "RangeExpression({})" , a. repr( ) )
1156
- }
1157
- EquatePredicate ( a) => {
1158
- format ! ( "EquatePredicate({})" , a. repr( ) )
1159
- }
1160
- }
1161
- }
1162
- }
1163
-
1164
1126
impl < ' tcx > SubregionOrigin < ' tcx > {
1165
1127
pub fn span ( & self ) -> Span {
1166
1128
match * self {
@@ -1190,70 +1152,6 @@ impl<'tcx> SubregionOrigin<'tcx> {
1190
1152
}
1191
1153
}
1192
1154
1193
- impl < ' tcx > Repr for SubregionOrigin < ' tcx > {
1194
- fn repr ( & self ) -> String {
1195
- match * self {
1196
- Subtype ( ref a) => {
1197
- format ! ( "Subtype({})" , a. repr( ) )
1198
- }
1199
- InfStackClosure ( a) => {
1200
- format ! ( "InfStackClosure({})" , a. repr( ) )
1201
- }
1202
- InvokeClosure ( a) => {
1203
- format ! ( "InvokeClosure({})" , a. repr( ) )
1204
- }
1205
- DerefPointer ( a) => {
1206
- format ! ( "DerefPointer({})" , a. repr( ) )
1207
- }
1208
- FreeVariable ( a, b) => {
1209
- format ! ( "FreeVariable({}, {})" , a. repr( ) , b)
1210
- }
1211
- IndexSlice ( a) => {
1212
- format ! ( "IndexSlice({})" , a. repr( ) )
1213
- }
1214
- RelateObjectBound ( a) => {
1215
- format ! ( "RelateObjectBound({})" , a. repr( ) )
1216
- }
1217
- RelateParamBound ( a, b) => {
1218
- format ! ( "RelateParamBound({},{})" ,
1219
- a. repr( ) ,
1220
- b. repr( ) )
1221
- }
1222
- RelateRegionParamBound ( a) => {
1223
- format ! ( "RelateRegionParamBound({})" ,
1224
- a. repr( ) )
1225
- }
1226
- RelateDefaultParamBound ( a, b) => {
1227
- format ! ( "RelateDefaultParamBound({},{})" ,
1228
- a. repr( ) ,
1229
- b. repr( ) )
1230
- }
1231
- Reborrow ( a) => format ! ( "Reborrow({})" , a. repr( ) ) ,
1232
- ReborrowUpvar ( a, b) => {
1233
- format ! ( "ReborrowUpvar({},{:?})" , a. repr( ) , b)
1234
- }
1235
- ReferenceOutlivesReferent ( _, a) => {
1236
- format ! ( "ReferenceOutlivesReferent({})" , a. repr( ) )
1237
- }
1238
- ExprTypeIsNotInScope ( a, b) => {
1239
- format ! ( "ExprTypeIsNotInScope({}, {})" ,
1240
- a. repr( ) ,
1241
- b. repr( ) )
1242
- }
1243
- BindingTypeIsNotValidAtDecl ( a) => {
1244
- format ! ( "BindingTypeIsNotValidAtDecl({})" , a. repr( ) )
1245
- }
1246
- CallRcvr ( a) => format ! ( "CallRcvr({})" , a. repr( ) ) ,
1247
- CallArg ( a) => format ! ( "CallArg({})" , a. repr( ) ) ,
1248
- CallReturn ( a) => format ! ( "CallReturn({})" , a. repr( ) ) ,
1249
- Operand ( a) => format ! ( "Operand({})" , a. repr( ) ) ,
1250
- AddrOf ( a) => format ! ( "AddrOf({})" , a. repr( ) ) ,
1251
- AutoBorrow ( a) => format ! ( "AutoBorrow({})" , a. repr( ) ) ,
1252
- SafeDestructor ( a) => format ! ( "SafeDestructor({})" , a. repr( ) ) ,
1253
- }
1254
- }
1255
- }
1256
-
1257
1155
impl RegionVariableOrigin {
1258
1156
pub fn span ( & self ) -> Span {
1259
1157
match * self {
@@ -1269,33 +1167,3 @@ impl RegionVariableOrigin {
1269
1167
}
1270
1168
}
1271
1169
}
1272
-
1273
- impl < ' tcx > Repr for RegionVariableOrigin {
1274
- fn repr ( & self ) -> String {
1275
- match * self {
1276
- MiscVariable ( a) => {
1277
- format ! ( "MiscVariable({})" , a. repr( ) )
1278
- }
1279
- PatternRegion ( a) => {
1280
- format ! ( "PatternRegion({})" , a. repr( ) )
1281
- }
1282
- AddrOfRegion ( a) => {
1283
- format ! ( "AddrOfRegion({})" , a. repr( ) )
1284
- }
1285
- Autoref ( a) => format ! ( "Autoref({})" , a. repr( ) ) ,
1286
- Coercion ( a) => format ! ( "Coercion({})" , a. repr( ) ) ,
1287
- EarlyBoundRegion ( a, b) => {
1288
- format ! ( "EarlyBoundRegion({},{})" , a. repr( ) , b. repr( ) )
1289
- }
1290
- LateBoundRegion ( a, b, c) => {
1291
- format ! ( "LateBoundRegion({},{},{:?})" , a. repr( ) , b. repr( ) , c)
1292
- }
1293
- BoundRegionInCoherence ( a) => {
1294
- format ! ( "bound_regionInCoherence({})" , a. repr( ) )
1295
- }
1296
- UpvarRegion ( a, b) => {
1297
- format ! ( "UpvarRegion({}, {})" , a. repr( ) , b. repr( ) )
1298
- }
1299
- }
1300
- }
1301
- }
0 commit comments