-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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
Metadata
Metadata
Assignees
Labels
A-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.