Remove deprecated string interpolation syntax

This commit is contained in:
hrishisd 2024-10-08 16:31:22 -04:00
parent 72011fba73
commit cb98c45e88
No known key found for this signature in database
GPG key ID: E447B3759263B767
15 changed files with 17 additions and 94 deletions

View file

@ -2515,9 +2515,7 @@ pub fn is_valid_interpolation(expr: &ast::Expr<'_>) -> bool {
| ast::StrSegment::Plaintext(_) => true,
// Disallow nested interpolation. Alternatively, we could allow it but require
// a comment above it apologizing to the next person who has to read the code.
ast::StrSegment::Interpolated(_) | ast::StrSegment::DeprecatedInterpolated(_) => {
false
}
ast::StrSegment::Interpolated(_) => false,
})
}
ast::Expr::Record(fields) => fields.iter().all(|loc_field| match loc_field.value {
@ -2648,7 +2646,7 @@ fn flatten_str_lines<'a>(
);
}
},
Interpolated(loc_expr) | DeprecatedInterpolated(loc_expr) => {
Interpolated(loc_expr) => {
if is_valid_interpolation(loc_expr.value) {
// Interpolations desugar to Str.concat calls
output.references.insert_call(Symbol::STR_CONCAT);