]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #86249 - FabianWolff:issue-86238, r=varkor
authorbors <bors@rust-lang.org>
Sun, 11 Jul 2021 22:39:16 +0000 (22:39 +0000)
committerbors <bors@rust-lang.org>
Sun, 11 Jul 2021 22:39:16 +0000 (22:39 +0000)
commit54aaca862374a8f296402822ec47d4f1586d54e3
tree4c73e8b80137745391ecc77eff27103266c0c3ef
parent7a16cfcffc58cd6994984a2c014b0cc27ed8f66b
parentdab25ab56cd7a8132281621ecdf7aee8dfdabd15
Auto merge of #86249 - FabianWolff:issue-86238, r=varkor

Report an error if resolution of closure call functions failed

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` 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 #86238. I have therefore turned the `span_bug!()` into an error message, which prevents the ICE.
compiler/rustc_typeck/src/check/callee.rs