@@ -360,8 +360,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
360360 self . convert_angle_bracketed_parameters ( rscope, span, decl_generics, data)
361361 }
362362 hir:: ParenthesizedParameters ( ..) => {
363- span_err ! ( tcx. sess, span, E0214 ,
364- "parenthesized parameters may only be used with a trait" ) ;
363+ struct_span_err ! ( tcx. sess, span, E0214 ,
364+ "parenthesized parameters may only be used with a trait" )
365+ . span_label ( span, & format ! ( "only traits may use parentheses" ) )
366+ . emit ( ) ;
367+
365368 let ty_param_defs = decl_generics. types . get_slice ( TypeSpace ) ;
366369 ( Substs :: empty ( ) ,
367370 ty_param_defs. iter ( ) . map ( |_| tcx. types . err ) . collect ( ) ,
@@ -1201,10 +1204,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
12011204 }
12021205
12031206 for ( trait_def_id, name) in associated_types {
1204- span_err ! ( tcx. sess, span, E0191 ,
1207+ struct_span_err ! ( tcx. sess, span, E0191 ,
12051208 "the value of the associated type `{}` (from the trait `{}`) must be specified" ,
12061209 name,
1207- tcx. item_path_str( trait_def_id) ) ;
1210+ tcx. item_path_str( trait_def_id) )
1211+ . span_label ( span, & format ! (
1212+ "missing associated type `{}` value" , name) )
1213+ . emit ( ) ;
12081214 }
12091215
12101216 tcx. mk_trait ( object. principal , object. bounds )
@@ -1281,10 +1287,12 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
12811287 }
12821288
12831289 if bounds. len ( ) > 1 {
1284- let mut err = struct_span_err ! ( self . tcx( ) . sess, span, E0221 ,
1285- "ambiguous associated type `{}` in bounds of `{}`" ,
1286- assoc_name,
1287- ty_param_name) ;
1290+ let mut err = struct_span_err ! (
1291+ self . tcx( ) . sess, span, E0221 ,
1292+ "ambiguous associated type `{}` in bounds of `{}`" ,
1293+ assoc_name,
1294+ ty_param_name) ;
1295+ err. span_label ( span, & format ! ( "ambiguous associated type `{}`" , assoc_name) ) ;
12881296
12891297 for bound in & bounds {
12901298 span_note ! ( & mut err, span,
@@ -1584,9 +1592,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
15841592 return self . tcx ( ) . types . err ;
15851593 }
15861594 _ => {
1587- span_err ! ( tcx. sess, span, E0248 ,
1588- "found value `{}` used as a type" ,
1589- tcx. item_path_str( def. def_id( ) ) ) ;
1595+ struct_span_err ! ( tcx. sess, span, E0248 ,
1596+ "found value `{}` used as a type" ,
1597+ tcx. item_path_str( def. def_id( ) ) )
1598+ . span_label ( span, & format ! ( "value used as a type" ) )
1599+ . emit ( ) ;
15901600 return self . tcx ( ) . types . err ;
15911601 }
15921602 }
0 commit comments