| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Fixes #78510
|
|
Fixes #78398
I forgot to handle this case in #77255
|
|
|
|
This allows us to avoid synthesizing tokens in `prepend_attr`, since we
have the original tokens available.
We still need to synthesize tokens when expanding `cfg_attr`,
but this is an unavoidable consequence of the syntax of `cfg_attr` -
the user does not supply the `#` and `[]` tokens that a `cfg_attr`
expands to.
|
|
This commit contains miscellaneous changes that don't fit into any of
the other commits in this PR
|
|
|
|
To match better naming from proc-macro
|
|
|
|
Suggested by @petrochenkov in https://github.com/rust-lang/rust/issues/43081#issuecomment-633389225
|
|
The previous implementation did not work when called on an opening
delimiter, or when called re-entrantly from the same `TokenCursor` stack
depth.
|
|
|
|
|
|
Fixes #68690
When we generate the proc macro harness, we now explicitly recorder the
order in which we generate entries. We then use this ordering data to
deserialize the correct proc-macro-data from the crate metadata.
|
|
|
|
`TokenStream` used to be a complex type, but it is now just a newtype
around a `Lrc<Vec<TreeAndJoint>>`. Currently it uses custom encoding
that discards the `IsJoint` and custom decoding that adds `NonJoint`
back in for every token tree. This requires building intermediate
`Vec<TokenTree>`s.
This commit makes `TokenStream` derive `Rustc{En,De}codable`. This
simplifies the code, and avoids the creation of the intermediate
vectors, saving up to 3% on various benchmarks. It also changes the AST
JSON output in one test.
|
|
|
|
Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.
|