@@ -357,23 +357,9 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
357
357
}
358
358
} ;
359
359
360
- let message_root_str = match trace. origin {
361
- infer:: Misc ( _) => "mismatched types" ,
362
- infer:: MethodCompatCheck ( _) => "method not compatible with trait" ,
363
- infer:: ExprAssignable ( _) => "mismatched types" ,
364
- infer:: RelateTraitRefs ( _) => "mismatched traits" ,
365
- infer:: RelateSelfType ( _) => "mismatched types" ,
366
- infer:: RelateOutputImplTypes ( _) => "mismatched types" ,
367
- infer:: MatchExpressionArm ( _, _) => "match arms have incompatible types" ,
368
- infer:: IfExpression ( _) => "if and else have incompatible types" ,
369
- infer:: IfExpressionWithNoElse ( _) => "if may be missing an else clause" ,
370
- infer:: RangeExpression ( _) => "start and end of range have incompatible types" ,
371
- infer:: EquatePredicate ( _) => "equality predicate not satisfied" ,
372
- } ;
373
-
374
360
span_err ! ( self . tcx. sess, trace. origin. span( ) , E0308 ,
375
361
"{}: {} ({})" ,
376
- message_root_str ,
362
+ trace . origin ,
377
363
expected_found_str,
378
364
ty:: type_err_to_str( self . tcx, terr) ) ;
379
365
@@ -1495,38 +1481,38 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
1495
1481
infer:: Subtype ( ref trace) => {
1496
1482
let desc = match trace. origin {
1497
1483
infer:: Misc ( _) => {
1498
- format ! ( "types are compatible" )
1484
+ "types are compatible"
1499
1485
}
1500
1486
infer:: MethodCompatCheck ( _) => {
1501
- format ! ( "method type is compatible with trait" )
1487
+ "method type is compatible with trait"
1502
1488
}
1503
1489
infer:: ExprAssignable ( _) => {
1504
- format ! ( "expression is assignable" )
1490
+ "expression is assignable"
1505
1491
}
1506
1492
infer:: RelateTraitRefs ( _) => {
1507
- format ! ( "traits are compatible" )
1493
+ "traits are compatible"
1508
1494
}
1509
1495
infer:: RelateSelfType ( _) => {
1510
- format ! ( "self type matches impl self type" )
1496
+ "self type matches impl self type"
1511
1497
}
1512
1498
infer:: RelateOutputImplTypes ( _) => {
1513
- format ! ( "trait type parameters matches those \
1514
- specified on the impl")
1499
+ "trait type parameters matches those \
1500
+ specified on the impl"
1515
1501
}
1516
1502
infer:: MatchExpressionArm ( _, _) => {
1517
- format ! ( "match arms have compatible types" )
1503
+ "match arms have compatible types"
1518
1504
}
1519
1505
infer:: IfExpression ( _) => {
1520
- format ! ( "if and else have compatible types" )
1506
+ "if and else have compatible types"
1521
1507
}
1522
1508
infer:: IfExpressionWithNoElse ( _) => {
1523
- format ! ( "if may be missing an else clause" )
1509
+ "if may be missing an else clause"
1524
1510
}
1525
1511
infer:: RangeExpression ( _) => {
1526
- format ! ( "start and end of range have compatible types" )
1512
+ "start and end of range have compatible types"
1527
1513
}
1528
1514
infer:: EquatePredicate ( _) => {
1529
- format ! ( "equality where clause is satisfied" )
1515
+ "equality where clause is satisfied"
1530
1516
}
1531
1517
} ;
1532
1518
@@ -1666,8 +1652,8 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
1666
1652
infer:: RelateRegionParamBound ( span) => {
1667
1653
self . tcx . sess . span_note (
1668
1654
span,
1669
- & format ! ( "...so that the declared lifetime parameter bounds \
1670
- are satisfied") ) ;
1655
+ "...so that the declared lifetime parameter bounds \
1656
+ are satisfied") ;
1671
1657
}
1672
1658
infer:: SafeDestructor ( span) => {
1673
1659
self . tcx . sess . span_note (
0 commit comments