@@ -160,7 +160,7 @@ pub enum ValuePairs<'tcx> {
160160/// encounter an error or subtyping constraint.
161161///
162162/// See `error_reporting.rs` for more details.
163- #[ derive( Clone , Debug ) ]
163+ #[ derive( Clone ) ]
164164pub struct TypeTrace < ' tcx > {
165165 origin : TypeOrigin ,
166166 values : ValuePairs < ' tcx > ,
@@ -708,7 +708,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
708708 value : & ty:: Binder < T > ,
709709 snapshot : & CombinedSnapshot )
710710 -> ( T , SkolemizationMap )
711- where T : TypeFoldable < ' tcx > + Repr
711+ where T : TypeFoldable < ' tcx >
712712 {
713713 /*! See `higher_ranked::skolemize_late_bound_regions` */
714714
@@ -733,7 +733,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
733733 snapshot : & CombinedSnapshot ,
734734 value : & T )
735735 -> T
736- where T : TypeFoldable < ' tcx > + Repr
736+ where T : TypeFoldable < ' tcx >
737737 {
738738 /*! See `higher_ranked::plug_leaks` */
739739
@@ -979,7 +979,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
979979 Some ( t) if ty:: type_is_error ( t) => ( ) ,
980980 _ => {
981981 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)
983983 } ) ;
984984
985985 self . tcx . sess . span_err ( sp, & format ! ( "{}{}" ,
@@ -1033,7 +1033,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
10331033 lbrct : LateBoundRegionConversionTime ,
10341034 value : & ty:: Binder < T > )
10351035 -> ( T , FnvHashMap < ty:: BoundRegion , ty:: Region > )
1036- where T : TypeFoldable < ' tcx > + Repr
1036+ where T : TypeFoldable < ' tcx >
10371037 {
10381038 ty_fold:: replace_late_bound_regions (
10391039 self . tcx ,
@@ -1099,9 +1099,9 @@ impl<'tcx> TypeTrace<'tcx> {
10991099 }
11001100}
11011101
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)
11051105 }
11061106}
11071107
@@ -1123,44 +1123,6 @@ impl TypeOrigin {
11231123 }
11241124}
11251125
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-
11641126impl < ' tcx > SubregionOrigin < ' tcx > {
11651127 pub fn span ( & self ) -> Span {
11661128 match * self {
@@ -1190,70 +1152,6 @@ impl<'tcx> SubregionOrigin<'tcx> {
11901152 }
11911153}
11921154
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-
12571155impl RegionVariableOrigin {
12581156 pub fn span ( & self ) -> Span {
12591157 match * self {
@@ -1269,33 +1167,3 @@ impl RegionVariableOrigin {
12691167 }
12701168 }
12711169}
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