Skip to content

Commit e40df1c

Browse files
Fix E0132 error display
1 parent f5e7a59 commit e40df1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_typeck/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,10 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
261261
match it.node {
262262
hir::ItemFn(_,_,_,_,ref ps,_)
263263
if ps.is_parameterized() => {
264-
struct_span_err!(tcx.sess, start_span, E0132,
264+
let sp = if let Some(sp) = ps.span() { sp } else { start_span };
265+
struct_span_err!(tcx.sess, sp, E0132,
265266
"start function is not allowed to have type parameters")
266-
.span_label(ps.span().unwrap(),
267+
.span_label(sp,
267268
&format!("start function cannot have type parameters"))
268269
.emit();
269270
return;

0 commit comments

Comments
 (0)