We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cab2732 commit ee342dcCopy full SHA for ee342dc
src/fn/closures.md
@@ -34,6 +34,9 @@ fn main() {
34
println!("function: {}", function(i));
35
println!("closure_annotated: {}", closure_annotated(i));
36
println!("closure_inferred: {}", closure_inferred(i));
37
+ // Once closure's type has been inferred, it cannot be inferred again with another type.
38
+ //println!("cannot reuse closure_inferred with another type: {}", closure_inferred(42i64));
39
+ // TODO: uncomment the line above and see the compiler error.
40
41
// A closure taking no arguments which returns an `i32`.
42
// The return type is inferred.
0 commit comments