diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs index 6f13d7994d17d..a096627a3f19e 100644 --- a/src/librustc_parse/parser/item.rs +++ b/src/librustc_parse/parser/item.rs @@ -1403,7 +1403,7 @@ impl<'a> Parser<'a> { }; err.multipart_suggestion( "change the delimiters to curly braces", - vec![(open, "{".to_string()), (close, '}'.to_string())], + vec![(open, "{".to_string()), (close, "}".to_string())], Applicability::MaybeIncorrect, ); } else { @@ -1417,7 +1417,7 @@ impl<'a> Parser<'a> { err.span_suggestion( span.shrink_to_hi(), "add a semicolon", - ';'.to_string(), + ";".to_string(), Applicability::MaybeIncorrect, ); err.emit(); diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 67bdd04d3715c..09e41d6914d6d 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -468,8 +468,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { item_name, ), vec![ - (expr_span.shrink_to_lo(), '('.to_string()), - (expr_span.shrink_to_hi(), ')'.to_string()), + (expr_span.shrink_to_lo(), "(".to_string()), + (expr_span.shrink_to_hi(), ")".to_string()), ], Applicability::MachineApplicable, ); diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 1d59d749634ee..920aadb101068 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -464,7 +464,7 @@ fn get_new_lifetime_name<'tcx>( let a_to_z_repeat_n = |n| { (b'a'..=b'z').map(move |c| { - let mut s = '\''.to_string(); + let mut s = "'".to_string(); s.extend(std::iter::repeat(char::from(c)).take(n)); s })