match field_ty.sty {
// Not all of these (e.g. unsafe fns) implement FnOnce
// so we look for these beforehand
- ty::TyClosure(..) | ty::TyBareFn(..) => {
+ ty::TyClosure(..) | ty::TyFnDef(..) | ty::TyFnPtr(_) => {
span_stored_function!();
}
// If it's not a simple function, look for things which implement FnOnce
for (i, trait_did) in candidates.iter().enumerate() {
err.fileline_help(span,
- &format!("candidate #{}: use `{}`",
+ &format!("candidate #{}: `use {}`",
i + 1,
fcx.tcx().item_path_str(*trait_did)));
}