-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Report an error if resolution of closure call functions failed #86249
Conversation
r? @varkor (rust-highfive has picked a reviewer for you, use r? to override) |
"make sure the `fn`/`fn_mut`/`fn_once` lang items are defined \ | ||
and have an associated `call`/`call_mut`/`call_once` function", |
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.
"make sure the `fn`/`fn_mut`/`fn_once` lang items are defined \ | |
and have an associated `call`/`call_mut`/`call_once` function", | |
"make sure the `fn`/`fn_mut`/`fn_once` lang items are defined \ | |
and have associated `call`/`call_mut`/`call_once` functions", |
Just to make sure the plurals match up.
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.
Fixed. Thanks for the review!
This looks good. r=me after tweaking the wording. Sorry for taking so long to get to this. |
Thanks! @bors r+ |
📌 Commit dab25ab has been approved by |
Report an error if resolution of closure call functions failed This pull request fixes rust-lang#86238. The current implementation seems to assume that resolution of closure call functions (I'm not sure what the proper term is; I mean `call` of `Fn` etc.) can never fail: https://github.com/rust-lang/rust/blob/60f1a2fc4b535ead9c85ce085fdce49b1b097531/compiler/rustc_typeck/src/check/callee.rs#L590-L595 But actually, it can, if the `fn`/`fn_mut`/`fn_once` lang items are not defined, or don't have an associated `call`/`call_mut`/`call_once` function, leading to the ICE described in rust-lang#86238. I have therefore turned the `span_bug!()` into an error message, which prevents the ICE.
☀️ Test successful - checks-actions |
This pull request fixes #86238. The current implementation seems to assume that resolution of closure call functions (I'm not sure what the proper term is; I mean
call
ofFn
etc.) can never fail:rust/compiler/rustc_typeck/src/check/callee.rs
Lines 590 to 595 in 60f1a2f
But actually, it can, if the
fn
/fn_mut
/fn_once
lang items are not defined, or don't have an associatedcall
/call_mut
/call_once
function, leading to the ICE described in #86238. I have therefore turned thespan_bug!()
into an error message, which prevents the ICE.