Skip to content

ICE when generating MIR #31913

Closed
Closed
@tillarnold

Description

@tillarnold

I tried to look at the MIR for the following code in the rust playground and got an internal compiler error. ( http://is.gd/oJVeYh )

fn main() {
  let t = 44;
  let r = 12;

  std::mem::swap(t,r)
}
<anon>:5:18: 5:19 error: mismatched types:
 expected `&mut _`,
    found `_`
(expected &-ptr,
    found integral variable) [E0308]
<anon>:5   std::mem::swap(t,r)
                          ^
<anon>:5:18: 5:19 help: see the detailed explanation for E0308
<anon>:5:20: 5:21 error: mismatched types:
 expected `&mut _`,
    found `_`
(expected &-ptr,
    found integral variable) [E0308]
<anon>:5   std::mem::swap(t,r)
                            ^
<anon>:5:20: 5:21 help: see the detailed explanation for E0308
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:330
note: Run with `RUST_BACKTRACE=1` for a backtrace.

playpen: application terminated with error code 101

If I try to run this in the playground using Nightly (and not to generate the MIR) I only get the correct mismatched types error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions