diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-18 16:17:46 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-18 16:17:46 +0100 |
| commit | 3af7df91fcbe4c5197e55dc78838aeb5aa978d89 (patch) | |
| tree | 7f5c77c2f156c2c26978c21e1cf66c194a88d9f7 /compiler/rustc_trait_selection/src | |
| parent | 35a99eef32a2b7b9d8e77dde539f869e522d181f (diff) | |
| download | rust-3af7df91fcbe4c5197e55dc78838aeb5aa978d89.tar.gz rust-3af7df91fcbe4c5197e55dc78838aeb5aa978d89.zip | |
use &str / String literals instead of format!()
Diffstat (limited to 'compiler/rustc_trait_selection/src')
3 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs index 7c9fde27420..f8efe9bfa9f 100644 --- a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs +++ b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs @@ -138,10 +138,10 @@ pub fn is_const_evaluatable<'tcx>( } else if uv.has_non_region_param() { NotConstEvaluatable::MentionsParam } else { - let guar = infcx.tcx.sess.delay_span_bug( - span, - format!("Missing value for constant, but no error reported?"), - ); + let guar = infcx + .tcx + .sess + .delay_span_bug(span, "Missing value for constant, but no error reported?"); NotConstEvaluatable::Error(guar) }; diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 2dd2c568bab..11eac052813 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -2332,9 +2332,9 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> { // get rid of :: between Trait and <type> // must be '::' between them, otherwise the parser won't accept the code suggestions.push((between_span, "".to_string(),)); - suggestions.push((generic_arg.span_ext.shrink_to_hi(), format!(">"))); + suggestions.push((generic_arg.span_ext.shrink_to_hi(), ">".to_string())); } else { - suggestions.push((trait_path_segment.ident.span.shrink_to_hi(), format!(">"))); + suggestions.push((trait_path_segment.ident.span.shrink_to_hi(), ">".to_string())); } err.multipart_suggestion( message, diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index d47a5ea3e37..5a4c87c56d5 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -2740,7 +2740,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } ty::Closure(def_id, _) => err.span_note( self.tcx.def_span(def_id), - &format!("required because it's used within this closure"), + "required because it's used within this closure", ), _ => err.note(&msg), }; @@ -3386,7 +3386,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } err.span_note( multi_span, - format!("the method call chain might not have had the expected associated types"), + "the method call chain might not have had the expected associated types", ); } } |
