-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 lowering_arena to avoid creating AST nodes on the fly #101499
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.
Just one nit. r=me afterwards.
@@ -140,6 +148,12 @@ struct LoweringContext<'a, 'hir> { | |||
generics_def_id_map: Vec<FxHashMap<LocalDefId, LocalDefId>>, | |||
} | |||
|
|||
struct LoweringArena { |
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.
Could you use rustc_arena::declare_arena
?
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.
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.
I meant using the macro rustc_arena::declare_arena
.
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've tried to use declare_arena
but that imposes a 'tcx
lifetime which any of the fields have. At that point I've tried _marker: PhantomData<&'tcx ()>
but then I got a bunch of lifetime errors and I ended thinking that using the macro may be more complicated than writing this manually.
Let me know if you still want to persue this or this is ready to be merged in the way it is.
e3bfef0
to
2df3743
Compare
r? @cjgillot |
@bors r=cjgillot |
📌 Commit 2df3743a2a4b3bcbdfeb98d4aca2d543e10e6881 has been approved by It is now in the queue for this repository. |
🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened. |
@bors rollup |
2df3743
to
ea09747
Compare
I think this should be merged as is, commented on the problem with |
@bors r+ rollup |
📌 Commit ea097476baa4eacb13715439565e34dac73a4c01 has been approved by It is now in the queue for this repository. |
ea09747
to
6a97b08
Compare
@cjgillot ended doing it with the macro, needed Edit: sorry that I didn't see you have already r+ed. Let me know which version do you prefer and I can |
6a97b08
to
d9a1faa
Compare
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#101423 (Fix hermit warnings) - rust-lang#101499 (Introduce lowering_arena to avoid creating AST nodes on the fly) - rust-lang#101530 (llvm-wrapper: adapt for LLVM API changes) - rust-lang#101554 (rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`) - rust-lang#101580 (rustdoc: remove unused CSS `div.impl-items > div`) - rust-lang#101584 (rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`) - rust-lang#101587 (Make `Debug` impl for `Term` useful) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Revert "Introduce lowering_arena to avoid creating AST nodes on the fly" This reverts commit d9a1faa (rust-lang#101499). This was originally part of rust-lang#101345 which has now been closed as a different approach is taken now. r? `@oli-obk` cc `@spastorino`
@oli-obk requested this and other changes as a way of simplifying #101345. This is just going to make the diff of #101345 smaller.
r? @oli-obk @cjgillot