-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Apply T! macro where posible #1278
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
Conversation
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.
Awesome!
This looks so much better now! Let's remove braces from the PR though: T!['}']
does not look exactly right
@@ -49,7 +49,7 @@ impl<N: AstNode> AstEditor<N> { | |||
|
|||
fn do_make_multiline(&mut self) { | |||
let l_curly = | |||
match self.ast().syntax().children_with_tokens().find(|it| it.kind() == L_CURLY) { | |||
match self.ast().syntax().children_with_tokens().find(|it| it.kind() == T!['{']) { |
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.
Hm, interesting, I've missed that while reviewing the original PR.
Indeed, we need quotes here, because {
break token tree structure. The API looks to sigil heavy as a result though.
Let's maybe scale this back, remove support for {, }, (, ), [, ] from T
and stick with L_CURLY
and friends?
Hm, OTOH, Let's just merge this, we can always revert to L_CURLY later :D bors r+ |
Build succeeded |
I've got the feeling that this increases compile time a lot. Is this known? |
Hm, no, I haven't check it, will run some benchmarks, thanks for the report. If you have already measured the impact of this change on compile time, I'd be interested in seeing the results! We might also look at the travis build times I guess. |
Hm, I've checked locally, and compile time seems the same. Specififivally, I've check f711237 repeateadly running
and
in both cases compile itme was more or less the same for both commits @jens1o could you give a little more details about where you are observing longer compile times? |
I digged a little bit further. At some point yesterday, I just quit compiling(I guessed that all the macro resolving took that much time). I now let it run for some while, only to notice that |
Hm, whihc version of |
I think this is the same as #1283: on the latest nightly I also get a very long compile time + overflow at the end. |
Ah, yes it is! Thank you very much and pardon me! |
Thanks for the report! Tacking that overflowing error is important: it has been my main gripe with rustc since all hands :D |
apply T! macro implemented in #1248