Skip to content

Commit e328ef0

Browse files
committed
Change some "did you mean self.*" messages to suggestions
1 parent 27359bd commit e328ef0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/librustc_resolve/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,18 +2323,20 @@ impl<'a> Resolver<'a> {
23232323
let self_is_available = this.self_value_is_available(path[0].ctxt, span);
23242324
match candidate {
23252325
AssocSuggestion::Field => {
2326-
err.span_label(span, format!("did you mean `self.{}`?", path_str));
2326+
err.span_suggestion(span, "did you mean",
2327+
format!("self.{}", path_str));
23272328
if !self_is_available {
23282329
err.span_label(span, format!("`self` value is only available in \
23292330
methods with `self` parameter"));
23302331
}
23312332
}
23322333
AssocSuggestion::MethodWithSelf if self_is_available => {
2333-
err.span_label(span, format!("did you mean `self.{}(...)`?",
2334-
path_str));
2334+
err.span_suggestion(span, "did you mean",
2335+
format!("self.{}", path_str));
23352336
}
23362337
AssocSuggestion::MethodWithSelf | AssocSuggestion::AssocItem => {
2337-
err.span_label(span, format!("did you mean `Self::{}`?", path_str));
2338+
err.span_suggestion(span, "did you mean",
2339+
format!("Self::{}", path_str));
23382340
}
23392341
}
23402342
return err;

0 commit comments

Comments
 (0)