@@ -2307,13 +2307,15 @@ impl<'a> Resolver<'a> {
23072307 . map ( |suggestion| import_candidate_to_paths ( & suggestion) ) . collect :: < Vec < _ > > ( ) ;
23082308 enum_candidates. sort ( ) ;
23092309 for ( sp, variant_path, enum_path) in enum_candidates {
2310- let msg = format ! ( "there is an enum variant `{}`, did you mean to use `{}`?" ,
2311- variant_path,
2312- enum_path) ;
23132310 if sp == DUMMY_SP {
2311+ let msg = format ! ( "there is an enum variant `{}`, \
2312+ try using `{}`?",
2313+ variant_path,
2314+ enum_path) ;
23142315 err. help ( & msg) ;
23152316 } else {
2316- err. span_help ( sp, & msg) ;
2317+ err. span_suggestion ( span, "you can try using the variant's enum" ,
2318+ enum_path) ;
23172319 }
23182320 }
23192321 }
@@ -2322,18 +2324,20 @@ impl<'a> Resolver<'a> {
23222324 let self_is_available = this. self_value_is_available ( path[ 0 ] . ctxt , span) ;
23232325 match candidate {
23242326 AssocSuggestion :: Field => {
2325- err. span_label ( span, format ! ( "did you mean `self.{}`?" , path_str) ) ;
2327+ err. span_suggestion ( span, "try" ,
2328+ format ! ( "self.{}" , path_str) ) ;
23262329 if !self_is_available {
23272330 err. span_label ( span, format ! ( "`self` value is only available in \
23282331 methods with `self` parameter") ) ;
23292332 }
23302333 }
23312334 AssocSuggestion :: MethodWithSelf if self_is_available => {
2332- err. span_label ( span, format ! ( "did you mean `self.{}(...)`? ",
2333- path_str) ) ;
2335+ err. span_suggestion ( span, "try ",
2336+ format ! ( "self.{}" , path_str) ) ;
23342337 }
23352338 AssocSuggestion :: MethodWithSelf | AssocSuggestion :: AssocItem => {
2336- err. span_label ( span, format ! ( "did you mean `Self::{}`?" , path_str) ) ;
2339+ err. span_suggestion ( span, "try" ,
2340+ format ! ( "Self::{}" , path_str) ) ;
23372341 }
23382342 }
23392343 return err;
0 commit comments