Closed
Description
I would like to record some API changes I would like to see in libproc_macro before we stabilize any of the new surface area. It would be best to give this a few months to collect more ideas, then batch these all up into one change that we can roll out across libproc_macro, proc-macro2, quote, and syn in a single round of breaking changes.
- Span that can point to closing delimiter of a delimited group #48187 Provide a way to have a Span that points to the closing delimiter of a delimited block. This is important for error messages that are comparable with rustc's errors, explained further in Tracking issue for RFC 1566: Procedural macros #38356 (comment).
- TokenTree::kind naming #48188 The naming of TokenTree::kind is confusing. I would expect either
kind: TokenKind
ornode: TokenNode
, notkind: TokenNode
. - Pass doc comments to proc macro not as a Literal #48189 Doc comments should be parsed as a sequence of tokens
#
[
doc
=
...]
rather than as a TokenNode::Literal. I believe this approach has worked well for macros-by-example. Nobody considers doc comments to be a type of "literal" and it can be surprising when they pop up this way.