Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustclosures Fn FnMut FnOnceSingle-choice MCQ

Why does the call to apply(c) on the last line fail to compile?

fn apply<F: Fn()>(f: F) { f(); } fn main() { let mut x = 0; let c = || { x += 1; }; apply(c); }