3 ms·
It can. -Z unstable-options -Zunpretty=hir,typed // source pub fn square(num: i32) -> i32 { num * num } // expanded use ::std::pr
by Tohquai7 8y 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/ https://rust.godbolt.org/
- steveklabnik 8y agoOh dang! That's very cool, thank you!