Closed as not planned
Description
The JSON emitted for the following AST is not legal JSON.
struct Struct;
trait Trait {}
macro_rules! impl_trait_for {
($s:ident) => {
impl Trait for $s {}
};
}
impl_trait_for!(Struct);
To reproduce:
rustc repro.rs -Z ast-json | rg ',]'
With indentation added, part of the JSON output looks like this. The problem is with the last ,
in this snippet.
{
"variant": "Token",
"fields": [
{
"lo": 104,
"hi": 106
},
{
"variant": "Interpolated",
"fields": [
[
{
"variant": "NtIdent",
"fields": [
"Struct",
false
]
},
]
]
}
]
}