diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2023-02-27 14:27:13 +0900 |
|---|---|---|
| committer | Takayuki Maeda <takoyaki0316@gmail.com> | 2023-02-27 14:27:13 +0900 |
| commit | 934c8c2299ec4b0b299ee5b018db875eba1f9e7d (patch) | |
| tree | e79460a25bd6c333a734aa464aa68c1f000bac49 /compiler | |
| parent | 58136ffa92c81ec9e6ac1f91773254914da2ca01 (diff) | |
| download | rust-934c8c2299ec4b0b299ee5b018db875eba1f9e7d.tar.gz rust-934c8c2299ec4b0b299ee5b018db875eba1f9e7d.zip | |
avoid `&str` to `String` conversions
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_ast_passes/src/feature_gate.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/move_errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 926b0da2ec6..96042ea3078 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -386,7 +386,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { ).span_suggestion_verbose( lhs.span.shrink_to_lo(), "you might have meant to introduce a new binding", - "let ".to_string(), + "let ", Applicability::MachineApplicable, ).emit(); } diff --git a/compiler/rustc_borrowck/src/diagnostics/move_errors.rs b/compiler/rustc_borrowck/src/diagnostics/move_errors.rs index ea58ad5ae3e..5e4c7292e59 100644 --- a/compiler/rustc_borrowck/src/diagnostics/move_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/move_errors.rs @@ -467,7 +467,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { err.span_suggestion_verbose( span.shrink_to_lo(), "consider borrowing here", - "&".to_string(), + '&', Applicability::MaybeIncorrect, ); } diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index 9f37b915b77..ef0542b57ad 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -385,7 +385,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { err.span_suggestion_verbose( local_decl.source_info.span.shrink_to_lo(), "consider changing this to be mutable", - "mut ".to_string(), + "mut ", Applicability::MachineApplicable, ); let tcx = self.infcx.tcx; |
