Closed
Description
#![feature(box_syntax)]
#[inline(always)]
pub fn f(a: usize, b: &mut usize, c: &[usize]) -> usize {
let x = a + a;
*b = c[x];
x
}
pub fn g(a: usize, b: &mut usize, c: &[usize]) -> usize {
f(a, b, c)
}
pub fn h(a: usize, b: &mut usize, c: &[usize]) -> Box<usize> {
box f(a, b, c)
}
$ rustc a.rs --crate-type=lib -O -Zmir-opt-level=3
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
left: `Index(_0)`,
right: `Index(_0)`', compiler/rustc_mir_transform/src/inline.rs:1035:13