@@ -1486,37 +1486,34 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
1486
1486
segment. with_generic_args ( |generic_args| {
1487
1487
let ( mut err_for_lt, mut err_for_ty, mut err_for_ct) = ( false , false , false ) ;
1488
1488
for arg in & generic_args. args {
1489
- let ( mut span_err, span, kind) = match arg {
1490
- // FIXME(varkor): unify E0109, E0110 and E0111.
1489
+ let ( span, kind) = match arg {
1491
1490
hir:: GenericArg :: Lifetime ( lt) => {
1492
1491
if err_for_lt { continue }
1493
1492
err_for_lt = true ;
1494
1493
has_err = true ;
1495
- ( struct_span_err ! ( self . tcx( ) . sess, lt. span, E0110 ,
1496
- "lifetime arguments are not allowed on this entity" ) ,
1497
- lt. span ,
1498
- "lifetime" )
1494
+ ( lt. span , "lifetime" )
1499
1495
}
1500
1496
hir:: GenericArg :: Type ( ty) => {
1501
1497
if err_for_ty { continue }
1502
1498
err_for_ty = true ;
1503
1499
has_err = true ;
1504
- ( struct_span_err ! ( self . tcx( ) . sess, ty. span, E0109 ,
1505
- "type arguments are not allowed on this entity" ) ,
1506
- ty. span ,
1507
- "type" )
1500
+ ( ty. span , "type" )
1508
1501
}
1509
1502
hir:: GenericArg :: Const ( ct) => {
1510
1503
if err_for_ct { continue }
1511
1504
err_for_ct = true ;
1512
- ( struct_span_err ! ( self . tcx( ) . sess, ct. span, E0111 ,
1513
- "const parameters are not allowed on this type" ) ,
1514
- ct. span ,
1515
- "const" )
1505
+ ( ct. span , "const" )
1516
1506
}
1517
1507
} ;
1518
- span_err. span_label ( span, format ! ( "{} argument not allowed" , kind) )
1519
- . emit ( ) ;
1508
+ let mut err = struct_span_err ! (
1509
+ self . tcx( ) . sess,
1510
+ span,
1511
+ E0109 ,
1512
+ "{} arguments are not allowed for this type" ,
1513
+ kind,
1514
+ ) ;
1515
+ err. span_label ( span, format ! ( "{} argument not allowed" , kind) ) ;
1516
+ err. emit ( ) ;
1520
1517
if err_for_lt && err_for_ty && err_for_ct {
1521
1518
break ;
1522
1519
}
0 commit comments