mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
avoid unnecessary &str
to String
conversions
This commit is contained in:
parent
33b55ac39f
commit
a3a3f4d840
@ -507,7 +507,7 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
|
||||
_ => "aren't",
|
||||
},
|
||||
),
|
||||
" else { todo!() }".to_string(),
|
||||
" else { todo!() }",
|
||||
Applicability::HasPlaceholders,
|
||||
);
|
||||
}
|
||||
|
@ -784,10 +784,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
|
||||
return false;
|
||||
}
|
||||
err.code(rustc_errors::error_code!(E0411));
|
||||
err.span_label(
|
||||
span,
|
||||
"`Self` is only available in impls, traits, and type definitions".to_string(),
|
||||
);
|
||||
err.span_label(span, "`Self` is only available in impls, traits, and type definitions");
|
||||
if let Some(item_kind) = self.diagnostic_metadata.current_item {
|
||||
err.span_label(
|
||||
item_kind.ident.span,
|
||||
|
@ -192,12 +192,12 @@ pub fn is_const_evaluatable<'tcx>(
|
||||
}
|
||||
let concrete = infcx.const_eval_resolve(param_env, uv, Some(span));
|
||||
match concrete {
|
||||
Err(ErrorHandled::TooGeneric) => {
|
||||
Err(NotConstEvaluatable::Error(infcx.tcx.sess.delay_span_bug(
|
||||
span,
|
||||
format!("Missing value for constant, but no error reported?"),
|
||||
)))
|
||||
}
|
||||
Err(ErrorHandled::TooGeneric) => Err(NotConstEvaluatable::Error(
|
||||
infcx
|
||||
.tcx
|
||||
.sess
|
||||
.delay_span_bug(span, "Missing value for constant, but no error reported?"),
|
||||
)),
|
||||
Err(ErrorHandled::Linted) => {
|
||||
let reported = infcx
|
||||
.tcx
|
||||
|
Loading…
Reference in New Issue
Block a user