X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_typeck%2Fcheck%2Fmethod%2Fsuggest.rs;h=e63366966636a7d7a493ce21805b6653189f8ab6;hb=b423a0f9ef488ca4cd9ff620a44566bb441eb21f;hp=1367db16314e2f53e3cbae16406546d320b5d5af;hpb=1407645f17b4127f922494acff58a19817f78d94;p=rust.git diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 1367db16314..e6336696663 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -101,7 +101,7 @@ macro_rules! span_did_you_mean { 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 @@ -271,7 +271,7 @@ fn suggest_traits_to_import<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, 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))); }