about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authortrevyn <230691+trevyn@users.noreply.github.com>2024-02-02 15:16:05 -0800
committertrevyn <230691+trevyn@users.noreply.github.com>2024-02-02 15:16:05 -0800
commitef37dcb7dbb444751b825adb55f2246b4fa3a52b (patch)
treef4e58aa36dc571adaa78647f55796801b4bdae41 /compiler/rustc_trait_selection/src
parentbf3c6c5bed498f41ad815641319a1ad9bcecb8e8 (diff)
downloadrust-ef37dcb7dbb444751b825adb55f2246b4fa3a52b.tar.gz
rust-ef37dcb7dbb444751b825adb55f2246b4fa3a52b.zip
Remove unnecessary `.to_string()`/`.as_str()`s
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs6
1 files changed, 3 insertions, 3 deletions
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 5bab57ca56c..a49c446aa0f 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -1288,7 +1288,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             err.span_suggestion_verbose(
                 obligation.cause.span.shrink_to_hi(),
                 "consider using clone here",
-                ".clone()".to_string(),
+                ".clone()",
                 Applicability::MaybeIncorrect,
             );
             return true;
@@ -3245,7 +3245,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                             err.span_suggestion_verbose(
                                 span,
                                 "you can use `impl Trait` as the argument type",
-                                "impl ".to_string(),
+                                "impl ",
                                 Applicability::MaybeIncorrect,
                             );
                             let sugg = if !needs_parens {
@@ -5203,7 +5203,7 @@ fn point_at_assoc_type_restriction(
                     err.span_suggestion_verbose(
                         path.span,
                         "replace the associated type with the type specified in this `impl`",
-                        tcx.type_of(new.def_id).skip_binder().to_string(),
+                        tcx.type_of(new.def_id).skip_binder(),
                         Applicability::MachineApplicable,
                     );
                 }