Closed
Description
Rustc used to be able to replace vec![1, 2, 3].iter().sum::<i32>()
with a constant when optimizing, not at the moment. It simply looks like a Layout method that is not inlinable.
(This is a regression strictly speaking — stable & beta can do this optimization, but not nightly.)
Code to reproduce:
pub fn sum_me() -> i32 {
vec![1, 2, 3].iter().sum::<i32>()
}