Reject suffixed string literals inside serde attrs

This commit is contained in:
David Tolnay
2023-07-09 10:55:43 -07:00
parent 117ef22142
commit 8264e002a7
3 changed files with 9 additions and 2 deletions
+7
View File
@@ -1418,6 +1418,13 @@ fn get_lit_str2(
..
}) = value
{
let suffix = lit.suffix();
if !suffix.is_empty() {
cx.error_spanned_by(
lit,
format!("unexpected suffix `{}` on string literal", suffix),
);
}
Ok(Some(lit.clone()))
} else {
cx.error_spanned_by(