-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[WIP] Remove ids from ast::Stmt and hir::Stmt #87981
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 81925c43af54c8277b50c63cdbd6934d96852484 with merge a52a6ff6458c7e403c0688534766d0eb58d707ca... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit 6aeceafcd6a04a0408d98233f42452f1f7b73782 with merge 7f2b8ca23dea09d75147052e29614a6e39bbe441... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit 741210c0c4b79c55040baaaeeb1d3d4f073add09 with merge 714cf7d474e2f80a32ce3db9b014e24cb0834aa2... |
☀️ Try build successful - checks-actions |
Queued 714cf7d474e2f80a32ce3db9b014e24cb0834aa2 with parent 4498e30, future comparison URL. |
Finished benchmarking try commit (714cf7d474e2f80a32ce3db9b014e24cb0834aa2): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
⌛ Trying commit a404da8 with merge 2e7172f5abd1fb24fdc05fb9553907214b17592e... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued 2e7172f5abd1fb24fdc05fb9553907214b17592e with parent 0fa3190, future comparison URL. |
Finished benchmarking try commit (2e7172f5abd1fb24fdc05fb9553907214b17592e): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit cd8eedf with merge 83a83392e6fb744ae3f64cb43aafc8ea08e88059... |
☀️ Try build successful - checks-actions |
Queued 83a83392e6fb744ae3f64cb43aafc8ea08e88059 with parent 2fc3c69, future comparison URL. |
Finished benchmarking try commit (83a83392e6fb744ae3f64cb43aafc8ea08e88059): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
I'm not certain if we should do this. Pros:
Cons:
Originally, I had hoped to do this just for the AST, to remove the special cases around statement |
Ok, if HIR processing logic wants a separate ID for statements, then let's have a separate ID for HIR statements, with that ID removed this PR doesn't look like a simplification at all. What I don't understand is why #87779 didn't "just work" (perhaps with minor modifications). |
Ok, now I understand why IDs have to be assigned to statements during placeholder substitution. Note that the same thing doesn't happen with attribute invocations in I think we should do the same thing with fn-like macro calls - pull out Besides the consistency with attributes, this is also consistent with the token-based expansion model (in which we are reparsing all nonterminals from tokens and AST pieces in macro_rules! two_items {
() => {
extern "C" {}
extern "C" {}
};
}
macro_rules! single_item_funneler {
($item:item) => {
$item
};
}
fn main() {
single_item_funneler! { two_items! {} }
} => macro_rules! two_items {
() => {
extern "C" {}
extern "C" {}
};
}
fn main() {
⟪
two_items! {}
⟫
} => fn main() {
extern "C" {}
extern "C" {}
} , in other words, I'll try to implement this scheme today. |
expand: Treat more macro calls as statement macro calls This PR implements the suggestion from rust-lang#87981 (comment) and treats fn-like macro calls inside `StmtKind::Item` and `StmtKind::Semi` as statement macro calls, which is consistent with treatment of attribute invocations in the same positions and with token-based macro expansion model in general. This also allows to remove a special case in `NodeId` assignment (previously tried in rust-lang#87779), and to use statement `NodeId`s for linting (`assign_id!`). r? `@Aaron1011`
expand: Treat more macro calls as statement macro calls This PR implements the suggestion from rust-lang#87981 (comment) and treats fn-like macro calls inside `StmtKind::Item` and `StmtKind::Semi` as statement macro calls, which is consistent with treatment of attribute invocations in the same positions and with token-based macro expansion model in general. This also allows to remove a special case in `NodeId` assignment (previously tried in rust-lang#87779), and to use statement `NodeId`s for linting (`assign_id!`). r? `@Aaron1011`
expand: Treat more macro calls as statement macro calls This PR implements the suggestion from rust-lang#87981 (comment) and treats fn-like macro calls inside `StmtKind::Item` and `StmtKind::Semi` as statement macro calls, which is consistent with treatment of attribute invocations in the same positions and with token-based macro expansion model in general. This also allows to remove a special case in `NodeId` assignment (previously tried in rust-lang#87779), and to use statement `NodeId`s for linting (`assign_id!`). r? `@Aaron1011`
cc #87779 #87969
r? @ghost