-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Remove NtItem
and NtStmt
#138083
base: master
Are you sure you want to change the base?
Remove NtItem
and NtStmt
#138083
Conversation
This involves replacing `nt_pretty_printing_compatibility_hack` with `stream_pretty_printing_compatibility_hack`. The handling of statements in `transcribe` is slightly different to other nonterminal kinds, due to the lack of `from_ast` implementation for empty statements. Notable test changes: - `tests/ui/proc-macro/expand-to-derive.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar.
This is temporarily needed for `x doc compiler` to work. They can be removed once the `Nonterminal` is removed (rust-lang#124141).
This time when converting them to proc-macro `Group` form.
Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in compiler/rustc_sanitizers cc @rust-lang/project-exploit-mitigations, @rcvalle Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery |
@@ -19,6 +19,7 @@ | |||
#![feature(never_type)] | |||
#![feature(rustdoc_internals)] | |||
#![feature(stmt_expr_attributes)] | |||
#![recursion_limit = "256"] // FIXME(nnethercote): remove once #124141 is done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this only affects rustdoc, could we gate the increase behind cfg_attr(doc, ...)
so we don't accidentaly start relying on the higher recursion limit.
} | ||
|
||
// In `mk_delimited` we avoid nesting invisible delimited | ||
// of the same `MetaVarKind`. Here we do the same but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason to do this?
Technically it still an incorrect thing to do until the rules with regard to wrapping are clarified in general (#133436 (comment)).
(Also, maybe still deduplicate only with the same MetaVarKind
like in mk_delimited
, because that would at least match the previous behavior of AST nonterminals, from what I understand.)
| token::Eof | ||
| token::CloseDelim(Delimiter::Invisible(InvisibleOrigin::MetaVar( | ||
MetaVarKind::Stmt | ||
))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no NtStmt
check here previously, so this was some pre-existing issue?
The rustdoc overflows are probably from the extra passes that rustdoc runs to determine the full set of auto trait implementations to document. |
Another piece of #124141.
r? @petrochenkov