Skip to content
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

Move process_configure_mod to rustc_parse #66565

Merged
merged 2 commits into from
Nov 22, 2019

Conversation

Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Nov 20, 2019

This removes the hack in favor of perhaps a less principled, but less painful, approach.

This also supports my work to decouple Session from librustc, as ParseSess currently has Attribute as "part" of it but after this PR will no longer do so.

@rust-highfive

This comment has been minimized.

@petrochenkov petrochenkov self-assigned this Nov 20, 2019
@Centril
Copy link
Contributor

Centril commented Nov 20, 2019

So this is basically undoing the point of 5011ec7.

This also supports my work to decouple Session from librustc, as ParseSess currently has Attribute as "part" of it but after this PR will no longer do so.

Can you elaborate on why Attribute presents a problem for the decoupling? Do you intend to decouple Session from libsyntax as well? That seems difficult for other reasons (e.g. features: Once<Features> also induces a dependency on libsyntax).

@Centril Centril added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 20, 2019
@Mark-Simulacrum
Copy link
Member Author

Attribute is a pretty complicated type (pulls in TokenStream, Path, MetaItem, etc.); the other obstacles to moving Session before libsyntax I've already eliminated on that branch.

Generally speaking I think 5011ec7 is unrelated? Maybe you pointed at the wrong commit and meant be023eb?

But regardless, I acknowledge that, but it seems like the placement into syntax_expand is just a matter of 'cfg should in theory be implemented via expansion, not tied into the parser.' I don't disagree with that goal, but I don't think we should pay the price in complexity -- threading through an fn-ptr/trait through multiple modules. AFAICT, that price would go away with the more correct design (i.e., resolving #64197), so it's not really preparing us for anything. I guess it pretty loudly shouts "oh no here's something that should be fixed" -- but I don't think we should try to actively make our lives harder just because there's not great splitting of responsibilities in the current design if it can be avoided.

@Centril
Copy link
Contributor

Centril commented Nov 20, 2019

[...] the other obstacles to moving Session before libsyntax I've already eliminated on that branch.

I see. I can understand this PR better in light of making Session independent of libsyntax. Since you're talking about "that branch", do you happen to have it available so I can understand the bigger picture?

Generally speaking I think 5011ec7 is unrelated? Maybe you pointed at the wrong commit and meant be023eb?

Yeah that's right.

but I don't think we should try to actively make our lives harder just because there's not great splitting of responsibilities in the current design if it can be avoided.

That's a fair enough point; some of the benefits from be023eb are still there this seems like a substantially smaller revert.

r=me once CI agrees, unless @petrochenkov has other thoughts.

@Mark-Simulacrum
Copy link
Member Author

master...Mark-Simulacrum:sess-decouple is the other branch (but we should not derail discussion here based on it); I think that if this PR doesn't stand alone successfully then I can include the commits onto that branch and we can see if the whole stands alone :)

@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@Mark-Simulacrum Mark-Simulacrum 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 Nov 20, 2019
@rust-highfive

This comment has been minimized.

The previous commit removes the use of this, and now we cleanup.
@Mark-Simulacrum
Copy link
Member Author

I'm going to leave this to @petrochenkov's approval.

@petrochenkov
Copy link
Contributor

Well, at least it isn't moved back to libsyntax.
@bors r+

@bors
Copy link
Contributor

bors commented Nov 21, 2019

📌 Commit 70805e6 has been approved by petrochenkov

@bors bors 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 Nov 21, 2019
@bors
Copy link
Contributor

bors commented Nov 22, 2019

⌛ Testing commit 70805e6 with merge eaac45a...

bors added a commit that referenced this pull request Nov 22, 2019
Move process_configure_mod to rustc_parse

This removes the hack in favor of perhaps a less principled, but less painful, approach.

This also supports my work to decouple `Session` from librustc, as `ParseSess` currently has `Attribute` as "part" of it but after this PR will no longer do so.
@bors
Copy link
Contributor

bors commented Nov 22, 2019

☀️ Test successful - checks-azure
Approved by: petrochenkov
Pushing eaac45a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 22, 2019
@bors bors merged commit 70805e6 into rust-lang:master Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants