@@ -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 )
@@ -1584,9 +1590,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
15841590 return self . tcx ( ) . types . err ;
15851591 }
15861592 _ => {
1587- span_err ! ( tcx. sess, span, E0248 ,
1588- "found value `{}` used as a type" ,
1589- tcx. item_path_str( def. def_id( ) ) ) ;
1593+ struct_span_err ! ( tcx. sess, span, E0248 ,
1594+ "found value `{}` used as a type" ,
1595+ tcx. item_path_str( def. def_id( ) ) )
1596+ . span_label ( span, & format ! ( "value used as a type" ) )
1597+ . emit ( ) ;
15901598 return self . tcx ( ) . types . err ;
15911599 }
15921600 }
0 commit comments