@@ -2409,13 +2409,15 @@ impl<'a> Resolver<'a> {
24092409 . map ( |suggestion| import_candidate_to_paths ( & suggestion) ) . collect :: < Vec < _ > > ( ) ;
24102410 enum_candidates. sort ( ) ;
24112411 for ( sp, variant_path, enum_path) in enum_candidates {
2412- let msg = format ! ( "there is an enum variant `{}`, did you mean to use `{}`?" ,
2413- variant_path,
2414- enum_path) ;
24152412 if sp == DUMMY_SP {
2413+ let msg = format ! ( "there is an enum variant `{}`, \
2414+ try using `{}`?",
2415+ variant_path,
2416+ enum_path) ;
24162417 err. help ( & msg) ;
24172418 } else {
2418- err. span_help ( sp, & msg) ;
2419+ err. span_suggestion ( span, "you can try using the variant's enum" ,
2420+ enum_path) ;
24192421 }
24202422 }
24212423 }
@@ -2424,18 +2426,20 @@ impl<'a> Resolver<'a> {
24242426 let self_is_available = this. self_value_is_available ( path[ 0 ] . ctxt , span) ;
24252427 match candidate {
24262428 AssocSuggestion :: Field => {
2427- err. span_label ( span, format ! ( "did you mean `self.{}`?" , path_str) ) ;
2429+ err. span_suggestion ( span, "try" ,
2430+ format ! ( "self.{}" , path_str) ) ;
24282431 if !self_is_available {
24292432 err. span_label ( span, format ! ( "`self` value is only available in \
24302433 methods with `self` parameter") ) ;
24312434 }
24322435 }
24332436 AssocSuggestion :: MethodWithSelf if self_is_available => {
2434- err. span_label ( span, format ! ( "did you mean `self.{}(...)`? ",
2435- path_str) ) ;
2437+ err. span_suggestion ( span, "try ",
2438+ format ! ( "self.{}" , path_str) ) ;
24362439 }
24372440 AssocSuggestion :: MethodWithSelf | AssocSuggestion :: AssocItem => {
2438- err. span_label ( span, format ! ( "did you mean `Self::{}`?" , path_str) ) ;
2441+ err. span_suggestion ( span, "try" ,
2442+ format ! ( "Self::{}" , path_str) ) ;
24392443 }
24402444 }
24412445 return err;
0 commit comments