You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without an explicit annotation, closure arguments are inferred to have a concrete lifetime. You must manually annotate the argument in order to satisfy a HRTB.
#[derive(PartialEq)]structFoo;fnuse_a_foo(_:&Fn(&Foo)){}fnmain() -> (){// This doesn't compile// let function = |foo_arg| {// assert!(&foo == foo_arg);// };// explicit_for(&foo, &function);// This doeslet function = |foo_arg:&_| {};use_a_foo(&function);}
The text was updated successfully, but these errors were encountered:
Without an explicit annotation, closure arguments are inferred to have a concrete lifetime. You must manually annotate the argument in order to satisfy a HRTB.
The text was updated successfully, but these errors were encountered: