Rollup merge of #35477 - GuillaumeGomez:fix_E0132, r=jonathandturner

Fix E0132 error display

Error and note now use the same span.

r? @jonathandturner
This commit is contained in:
Jonathan Turner 2016-08-08 13:25:58 -07:00 committed by GitHub
commit 8a7edc0116

View File

@ -265,9 +265,10 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
match it.node {
hir::ItemFn(_,_,_,_,ref ps,_)
if ps.is_parameterized() => {
struct_span_err!(tcx.sess, start_span, E0132,
let sp = if let Some(sp) = ps.span() { sp } else { start_span };
struct_span_err!(tcx.sess, sp, E0132,
"start function is not allowed to have type parameters")
.span_label(ps.span().unwrap(),
.span_label(sp,
&format!("start function cannot have type parameters"))
.emit();
return;