about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-08-29 17:46:29 +0000
committerbors <bors@rust-lang.org>2021-08-29 17:46:29 +0000
commitae0b03bc6b4e1544f43b9a8053bdb0f0ed4a19e1 (patch)
tree42249083f8e03da1de24a7b775c1d2e6e182954d /compiler/rustc_parse/src/parser/mod.rs
parentdaa4dc997c777676b0f0e48d0311cc5e7bde5f87 (diff)
parentc565339c37def41500c6d3175c2db3be8c5c4f76 (diff)
downloadrust-ae0b03bc6b4e1544f43b9a8053bdb0f0ed4a19e1.tar.gz
rust-ae0b03bc6b4e1544f43b9a8053bdb0f0ed4a19e1.zip
Auto merge of #88262 - klensy:pprust-cow, r=nagisa
Cow'ify some pprust methods

Reduce number of potential needless de/allocations by using `Cow<'static, str>` instead of explicit `String` type.
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 4c3c140d171..c34fd02e806 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -806,7 +806,7 @@ impl<'a> Parser<'a> {
                                         .span_suggestion_short(
                                             sp,
                                             &format!("missing `{}`", token_str),
-                                            token_str,
+                                            token_str.into(),
                                             Applicability::MaybeIncorrect,
                                         )
                                         .emit();