Hacker News new | ask | show | jobs
by Tohquai7 2666 days ago
It can.

-Z unstable-options -Zunpretty=hir,typed

    // source
    pub fn square(num: i32) -> i32 {
        num * num
    }

    // expanded
    use ::std::prelude::v1::*;
    extern crate std;
    pub fn square(num: i32)
     -> i32 ({ ((num as i32) * (num as i32) as i32) } as i32)

You can try on https://rust.godbolt.org/
1 comments

Oh dang! That's very cool, thank you!