Byte and char literals must not contain the characters ', LF, CR, or TAB. However, proc-macro2 accepts all of these and parses them as a byte literal.
use std::str::FromStr;
fn main() {
for input in [
"b'''",
"b'\r'",
"b'\n'",
"b'\t'",
] {
println!("{:?}", proc_macro2::TokenStream::from_str(input));
}
}
Checked here I believe.
Using proc-macro2 1.0.106.