-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix E0132 error display #35477
Fix E0132 error display #35477
Conversation
@@ -261,9 +261,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 = ps.span().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks okay, though I'm not 100% sure there's always a span if it's .is_parameterized().
We could support a fallback with something like:
let sp = if let Some(span) = ps.span() { span } else { start_span };
Looks okay, though I left a comment on one way we might allow it to fallback to the larger span if there's ever a case we don't have the smaller span. |
1861fc7
to
e40df1c
Compare
Updated. |
@bors r+ rollup |
📌 Commit e40df1c has been approved by |
⌛ Testing commit e40df1c with merge b605013... |
💔 Test failed - auto-win-gnu-64-opt |
That is quite the strange error! |
@bors retry |
@bors: retry
|
…ndturner Fix E0132 error display Error and note now use the same span. r? @jonathandturner
…ndturner Fix E0132 error display Error and note now use the same span. r? @jonathandturner
Error and note now use the same span.
r? @jonathandturner