Closed
Description
$ rustc -V
rustc 1.23.0-nightly (90ef3372e 2017-10-29)
$ rustc klosure.rs
$ ./klosure
28
$ rustc klosure.rs -Z mir-opt-level=2
Function return type does not match operand type of return inst!
ret { i32, [0 x i8], i32, [0 x i8] } %15
i32LLVM ERROR: Broken function found, compilation aborted!
Code:
fn main() {
println!("{}", foo(0, 14));
}
fn foo<T: Copy>(_t: T, q: i32) -> i32 {
let x = |_t, _q| _t;
x(q*2, q*3)
}
Expected result: no LLVM assert, should work.