diff --git a/src/fn/closures.md b/src/fn/closures.md index a0a33efba1..0c1b999efd 100644 --- a/src/fn/closures.md +++ b/src/fn/closures.md @@ -34,6 +34,9 @@ fn main() { println!("function: {}", function(i)); println!("closure_annotated: {}", closure_annotated(i)); println!("closure_inferred: {}", closure_inferred(i)); + // Once closure's type has been inferred, it cannot be inferred again with another type. + //println!("cannot reuse closure_inferred with another type: {}", closure_inferred(42i64)); + // TODO: uncomment the line above and see the compiler error. // A closure taking no arguments which returns an `i32`. // The return type is inferred.