Stream: t-compiler/wg-mir-opt

Topic: -Zvalidate-mir errors on master


Jonas Schievink (Jun 07 2020 at 17:00, on Zulip):

Running the test suite with -Zvalidate-mir enabled I'm getting a lot of errors about incorrect callee types:

error: internal compiler error: broken MIR in DefId(1:2106 ~ core[66db]::ops[0]::function[0]::FnMut[0]::call_mut[0]) (input to phase Const) at bb0[0]:
encountered non-callable type Self in `Call` terminator
   --> /home/jonas/dev/rust/src/libcore/ops/function.rs:154:5
    |
154 |     extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Presumably it needs to accept Self as well there?

cc @RalfJ

Jonas Schievink (Jun 07 2020 at 17:11, on Zulip):

I have a fix that I'll roll into my next PR for the validator

RalfJ (Jun 07 2020 at 17:11, on Zulip):

Sounds to me like it has to normalzie more

RalfJ (Jun 07 2020 at 17:11, on Zulip):

Self is not something you can actually call (Miri would ICE on such MIR)

Jonas Schievink (Jun 07 2020 at 17:15, on Zulip):

is it not generic?

Jonas Schievink (Jun 07 2020 at 17:16, on Zulip):

I mean validation happens on generic MIR at least, and I'm not sure there's a subst for Self there

Jonas Schievink (Jun 07 2020 at 17:16, on Zulip):

(I'm not actually sure what function this is, probably an FnOnce shim)

Matthew Jasper (Jun 07 2020 at 17:22, on Zulip):

build_call_shim should probably substitute the actual type for Self, it has it available.

Jonas Schievink (Jun 07 2020 at 17:22, on Zulip):

Ah, okay

RalfJ (Jun 08 2020 at 07:49, on Zulip):

https://github.com/rust-lang/rust/issues/73109

Last update: Sep 28 2020 at 15:30UTC