// skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 //@ only-64bit #[inline(always)] fn map(slf: Option, f: F) -> Option where F: FnOnce(T) -> U, { match slf { Some(x) => Some(f(x)), None => None, } } // EMIT_MIR simple_option_map.ezmap.PreCodegen.after.mir pub fn ezmap(x: Option) -> Option { map(x, |n| n + 1) } fn main() { assert_eq!(None, ezmap(None)); }