mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-30 14:27:54 +00:00
Reject suffixed string literals inside serde attrs
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user