]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/method/suggest.rs
Split TyBareFn into TyFnDef and TyFnPtr.
[rust.git] / src / librustc_typeck / check / method / suggest.rs
index 064259c171d91bb638192068bc2fbfd4e2a757b0..e63366966636a7d7a493ce21805b6653189f8ab6 100644 (file)
@@ -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)));
         }
@@ -316,7 +316,7 @@ fn suggest_traits_to_import<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
 
         for (i, trait_info) in candidates.iter().enumerate() {
             err.fileline_help(span,
-                              &*format!("candidate #{}: `{}`",
+                              &format!("candidate #{}: `{}`",
                                         i + 1,
                                         fcx.tcx().item_path_str(trait_info.def_id)));
         }