1
Fork 0

Rollup merge of #98043 - TaKO8Ki:remove-unnecessary-to-string, r=davidtwco

Remove unnecessary `to_string` and `String::new`

https://github.com/rust-lang/rust/pull/96468/commits/73fa217bc11fbac76f730223f6766c8e03513b5e changed the type of the `suggestion` argument to `impl ToString`. This patch removes unnecessary `to_string` and `String::new`.

cc: `````@davidtwco`````
This commit is contained in:
Matthias Krüger 2022-06-13 21:35:56 +02:00 committed by GitHub
commit 9d27f2e665
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
91 changed files with 299 additions and 352 deletions

View file

@ -1035,7 +1035,7 @@ fn emit_unstable_in_stable_error(ccx: &ConstCx<'_, '_>, span: Span, gate: Symbol
.span_suggestion(
attr_span,
"if it is not part of the public API, make this function unstably const",
concat!(r#"#[rustc_const_unstable(feature = "...", issue = "...")]"#, '\n').to_owned(),
concat!(r#"#[rustc_const_unstable(feature = "...", issue = "...")]"#, '\n'),
Applicability::HasPlaceholders,
)
.span_suggestion(