Closed
Description
Consider a small rust program such as this
pub trait A { fn foo(&self) {} }
#[inline(never)]
pub fn foo(slot: &mut Option<~A>) {
slot.get_mut_ref().foo();
}
This program should essentially be a check of the discriminant followed by a vtable load + dynamic dispatch. Consider, however, the --opt-level=3
IR:
https://gist.github.com/alexcrichton/8429375
Note that I had to put that in a gist because it was too large to inline here. In summary this is generating 1500 lines of IR. This turns into kilobytes of code.
Something very odd is going on here, and this really needs to be fixed.
Nominating