Skip to content

Commit 2c78c42

Browse files
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 9c1e4cb + e40df1c commit 2c78c42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_typeck/lib.rs

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

0 commit comments

Comments
 (0)