]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #97557 - compiler-errors:arg-mismatch-mini, r=jackh726
authorMichael Goulet <michael@errs.io>
Wed, 8 Jun 2022 20:32:18 +0000 (13:32 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Jun 2022 20:32:18 +0000 (13:32 -0700)
commit1922f0b9802a2edee8bacc3639f651b82d38edd1
treec630950a8cfa9f85c0648f074b1395dd34462081
parent263d8682d6e01bb02727b15b1c72ffabc0e7396b
parent4b26d410880fc06a8035ae3efa7b01a243ed7e75
Rollup merge of #97557 - compiler-errors:arg-mismatch-mini, r=jackh726

Fix indices and remove some unwraps in arg mismatch algorithm

This is a more conservative fix than #97542, addressing some indices which were used incorectly and unwraps which are bound to panic (e.g. when the provided and expected arg counts differ). Beta nominating this as it's quite easy to cause ICEs -- I wrote a fuzzer and found hundreds of examples of ICEs.

cc `@jackh726` as author of #92364, and `@estebank` as reviewer of that PR.
fixes #97484
r? `@jackh726` this should be _much_ easier to review than the other PR :sweat_smile:
compiler/rustc_typeck/src/check/fn_ctxt/checks.rs