@@ -360,8 +360,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
360
360
self . convert_angle_bracketed_parameters ( rscope, span, decl_generics, data)
361
361
}
362
362
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
+
365
368
let ty_param_defs = decl_generics. types . get_slice ( TypeSpace ) ;
366
369
( Substs :: empty ( ) ,
367
370
ty_param_defs. iter ( ) . map ( |_| tcx. types . err ) . collect ( ) ,
@@ -1201,10 +1204,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
1201
1204
}
1202
1205
1203
1206
for ( trait_def_id, name) in associated_types {
1204
- span_err ! ( tcx. sess, span, E0191 ,
1207
+ struct_span_err ! ( tcx. sess, span, E0191 ,
1205
1208
"the value of the associated type `{}` (from the trait `{}`) must be specified" ,
1206
1209
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 ( ) ;
1208
1214
}
1209
1215
1210
1216
tcx. mk_trait ( object. principal , object. bounds )
@@ -1584,9 +1590,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
1584
1590
return self . tcx ( ) . types . err ;
1585
1591
}
1586
1592
_ => {
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 ( ) ;
1590
1598
return self . tcx ( ) . types . err ;
1591
1599
}
1592
1600
}
0 commit comments