Skip to content

Introduce lowering_arena to avoid creating AST nodes on the fly - #101499

Merged
bors merged 1 commit into
rust-lang:masterfrom
spastorino:add-lowering-arena
Sep 9, 2022
Merged

Introduce lowering_arena to avoid creating AST nodes on the fly#101499
bors merged 1 commit into
rust-lang:masterfrom
spastorino:add-lowering-arena

Conversation

@spastorino

Copy link
Copy Markdown
Member

@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

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 6, 2022
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 6, 2022

@cjgillotcjgillot left a comment

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
MemberAuthor

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.

Comment threadcompiler/rustc_ast_lowering/src/lib.rs Outdated
@oli-obk

Copy link
Copy Markdown
Contributor

r? @cjgillot

@rust-highfiverust-highfive assigned cjgillot and unassigned oli-obkSep 7, 2022
@spastorino

Copy link
Copy Markdown
MemberAuthor

Just one nit. r=me afterwards.

@bors r=cjgillot

@bors

bors commented Sep 7, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 2df3743a2a4b3bcbdfeb98d4aca2d543e10e6881 has been approved by cjgillot

It is now in the queue for this repository.

@bors

bors commented Sep 7, 2022

Copy link
Copy Markdown
Collaborator

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 7, 2022
@spastorino

Copy link
Copy Markdown
MemberAuthor

@bors rollup

@spastorino

Copy link
Copy Markdown
MemberAuthor

@bors r-

I've figured that I misunderstood @cjgillot comment, gonna address the problem in a bit

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 7, 2022
@spastorino

Copy link
Copy Markdown
MemberAuthor

I think this should be merged as is, commented on the problem with declare_arena in #101499 (comment)

@spastorinospastorino added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 8, 2022
@cjgillot

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Sep 8, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit ea097476baa4eacb13715439565e34dac73a4c01 has been approved by cjgillot

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 8, 2022
@spastorino

spastorino commented Sep 8, 2022

Copy link
Copy Markdown
MemberAuthor

@cjgillot ended doing it with the macro, needed PhantomData on the definition and 'static on the call site. Let me know if this version is better for you or the old one.

Edit: sorry that I didn't see you have already r+ed. Let me know which version do you prefer and I can r=cjgillot

@spastorino

Copy link
Copy Markdown
MemberAuthor

@oli-obk said "leave a comment on the PhanomData field and r=me"

@bors r=oli-obk rollup

@bors

bors commented Sep 8, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit d9a1faa has been approved by oli-obk

It is now in the queue for this repository.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 8, 2022
…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
@bors
bors merged commit 1499c08 into rust-lang:masterSep 9, 2022
@rustbotrustbot added this to the 1.65.0 milestone Sep 9, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 18, 2022
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`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@spastorino@oli-obk@bors@cjgillot@rust-highfive@rustbot