Skip to content

Commit

Permalink
Rollup merge of rust-lang#35477 - GuillaumeGomez:fix_E0132, r=jonatha…
Browse files Browse the repository at this point in the history
…ndturner

Fix E0132 error display

Error and note now use the same span.

r? @jonathandturner
  • Loading branch information
Jonathan Turner committed Aug 8, 2016
2 parents bbbac59 + e40df1c commit 8a7edc0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8a7edc0

Please sign in to comment.