Skip to content
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

Broken MIR - call dest mismatch (warning appeared after updating to 1.8 stable) #32983

Closed
mitchmindtree opened this issue Apr 15, 2016 · 3 comments
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html

Comments

@mitchmindtree
Copy link
Contributor

When compiling the conrod examples after updating to 1.8 stable, the following Broken MIR warning has been appearing:

examples/all_widgets.rs:145:39: 145:44 warning: broken MIR (var1 = conrod::ui::Ui<B>::new(tmp23, tmp25) -> [return: bb46, unwind: bb45]): call dest mismatch (conrod::ui::Ui<(gfx_texture::Texture<gfx_device_gl::Resources>, gfx_graphics::glyph::GlyphCache<gfx_device_gl::Resources, gfx_device_gl::factory::Factory>)> <- conrod::ui::Ui<(<gfx_graphics::back_end::GfxGraphics<'static, gfx_device_gl::Resources, gfx_device_gl::command::CommandBuffer> as graphics::graphics::Graphics>::Texture, gfx_graphics::glyph::GlyphCache<gfx_device_gl::Resources, gfx_device_gl::factory::Factory>)>): Sorts(ExpectedFound { expected: gfx_texture::Texture<gfx_device_gl::Resources>, found: <gfx_graphics::back_end::GfxGraphics<'static, gfx_device_gl::Resources, gfx_device_gl::command::CommandBuffer> as graphics::graphics::Graphics>::Texture })
examples/all_widgets.rs:145         Ui::new(glyph_cache.unwrap(), theme)

Here is the code from the conrod example that causes the warning.

The same warning also appears in each of the other conrod examples at the same line (i.e. here and here and so on for the other examples).

I found #32959 which also gives a broken MIR warning, however the warning seems to be slightly different so I thought I'd post a new issue.

@Aatch
Copy link
Contributor

Aatch commented Apr 15, 2016

Looks like the associated type isn't getting normalized. Given that it "expects" an associated type.

@nagisa nagisa added the A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html label Apr 15, 2016
@nagisa
Copy link
Member

nagisa commented Apr 15, 2016

Smaller example:

trait A {
    type B;
}

impl A for () {
    type B = u32;
}

struct D<B>(::std::marker::PhantomData<B>);

impl<B> D<B> {
    fn new() -> D<B> {
        D(::std::marker::PhantomData)
    }
}

type U = D<<() as A>::B>;

fn main() {
    let _ = U::new();
}

@nagisa
Copy link
Member

nagisa commented Apr 15, 2016

This is a duplicate of #28828. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
Projects
None yet
Development

No branches or pull requests

3 participants