-
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
Introduce NonterminalKind for more type-safe mbe parsing #74826
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I also want to change |
Ah, |
This code is quite out of cache for me, but any improvements are very well! 🎉 |
Switched to |
Yup, so the second commit uses NonterminalKind for MetaVarDecl as well, ready for review now! |
The remaining weirdness with Option is due to #40107 I belive. I'll tackle that next, seems fine to try to hard error now. |
It encapsulate the (part of) the interface between the parser and macro by example (macro_rules) parser. The second bit is somewhat more general `parse_ast_fragment`, which is the reason why we keep some `parse_xxx` functions as public.
This is more type safe and allows us to remove a few dead branches
Seems to be a fallout from rustfmt transition
@bors r+ |
📌 Commit 1a2d07e has been approved by |
|
||
use crate::lexer::UnmatchedBrace; | ||
use diagnostics::Error; | ||
pub use path::PathStyle; |
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.
Are there any word of mouth and/or written guidelines about the ordering of mods and uses? I've fixed this negatively, by not mixing uses and modules in random order, but i am wondering what the positive fix would look like. In rust-analyer, we are somewhat picky about this: https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/style.md#order-of-imports
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.
I don't think there's an official guideline, but the most common order is
use crate::things;
use other_crate::things;
use std::things;
mod foo;
/* Other items */
⌛ Testing commit 1a2d07e with merge 8ae5d23b3623b4622364808137967732e0783d70... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-actions |
Seems to be a spurious network error:
@bors retry |
☀️ Test successful - checks-actions, checks-azure |
…y, r=matklad Restore public visibility on some parsing functions for rustfmt In rust-lang#74826 the visibility of several parsing functions was reduced. However, rustfmt is an external consumer of some of these functions as well and needs the visibility to be public, similar to other elements in rustc_parse such as `parse_ident` https://github.com/rust-lang/rust/blob/db534b3ac286cf45688c3bbae6aa6e77439e52d2/src/librustc_parse/parser/mod.rs#L433-L436
It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.
The second bit is somewhat more general
parse_ast_fragment
, which isthe reason why we keep some
parse_xxx
functions as public.