-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proc_macro does not have a constructor for byte literals #71358
Comments
This seems important. Is there something we're missing? |
Byte literal chars are "just" sugar for |
@CAD97's comments notwithstanding, I still don't get why this constructor is missing. It makes it impossible to construct a token stream that is a high-fidelity representation of the input (which can have implications for error message). It also has implications for round tripping. |
implement Literal::byte_character without this, the only way to create a `LitKind::Byte` is by doing `"b'a'".parse::<Literal>()`, this solves that by enabling `Literal::byte_character(b'a')` cc rust-lang#71358 I think this could be done as a FCP, but I've made it as a unstable feature for now until that's decided. The tracking issue is currently wrong.
implement Literal::byte_character without this, the only way to create a `LitKind::Byte` is by doing `"b'a'".parse::<Literal>()`, this solves that by enabling `Literal::byte_character(b'a')` cc rust-lang#71358 I think this could be done as a FCP, but I've made it as a unstable feature for now until that's decided. The tracking issue is currently wrong.
implement Literal::byte_character without this, the only way to create a `LitKind::Byte` is by doing `"b'a'".parse::<Literal>()`, this solves that by enabling `Literal::byte_character(b'a')` cc rust-lang#71358 The tracking issue is rust-lang#115268
This has been added as |
We have
Literal::string(&str)
for string literals,Literal::character(char)
for character literals, andLiteral::byte_string(&[u8])
for byte string literals, but noLiteral::byte_character(u8)
for byte literals.The text was updated successfully, but these errors were encountered: