Skip to content

Commit 8a7edc0

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35477 - GuillaumeGomez:fix_E0132, r=jonathandturner
Fix E0132 error display Error and note now use the same span. r? @jonathandturner
2 parents bbbac59 + e40df1c commit 8a7edc0

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
@@ -265,9 +265,10 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
265265
match it.node {
266266
hir::ItemFn(_,_,_,_,ref ps,_)
267267
if ps.is_parameterized() => {
268-
struct_span_err!(tcx.sess, start_span, E0132,
268+
let sp = if let Some(sp) = ps.span() { sp } else { start_span };
269+
struct_span_err!(tcx.sess, sp, E0132,
269270
"start function is not allowed to have type parameters")
270-
.span_label(ps.span().unwrap(),
271+
.span_label(sp,
271272
&format!("start function cannot have type parameters"))
272273
.emit();
273274
return;

0 commit comments

Comments
 (0)