Rollup merge of #99103 - TaKO8Ki:avoid-&str-to-string-conversions, r=oli-obk
Avoid some `&str` to `String` conversions This patch removes some `&str` to `String` conversions.
This commit is contained in:
commit
86af7135ae
13 changed files with 23 additions and 34 deletions
|
@ -943,10 +943,7 @@ impl<'a> Resolver<'a> {
|
|||
"generic parameters with a default cannot use \
|
||||
forward declared identifiers"
|
||||
);
|
||||
err.span_label(
|
||||
span,
|
||||
"defaulted generic parameters cannot be forward declared".to_string(),
|
||||
);
|
||||
err.span_label(span, "defaulted generic parameters cannot be forward declared");
|
||||
err
|
||||
}
|
||||
ResolutionError::ParamInTyOfConstParam(name) => {
|
||||
|
|
|
@ -349,10 +349,8 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
|
|||
|
||||
err.code(rustc_errors::error_code!(E0424));
|
||||
err.span_label(span, match source {
|
||||
PathSource::Pat => "`self` value is a keyword and may not be bound to variables or shadowed"
|
||||
.to_string(),
|
||||
_ => "`self` value is a keyword only available in methods with a `self` parameter"
|
||||
.to_string(),
|
||||
PathSource::Pat => "`self` value is a keyword and may not be bound to variables or shadowed",
|
||||
_ => "`self` value is a keyword only available in methods with a `self` parameter",
|
||||
});
|
||||
if let Some((fn_kind, span)) = &self.diagnostic_metadata.current_function {
|
||||
// The current function has a `self' parameter, but we were unable to resolve
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue