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

Remove implicit dependencies on syntax::pprust #65363

Merged
merged 3 commits into from
Oct 14, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 13, 2019

Part of #65324.

The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer.

r? @estebank

Instead just use `pprust::path_to_string(..)` where needed.

This has two benefits:

a) The AST definition is now independent of printing it.
   (Therefore we get closer to extracting a data-crate.)

b) Debugging should be easier as program flow is clearer.
@Centril Centril changed the title Remove implicit dependencies in syntax::pprust Remove implicit dependencies on syntax::pprust Oct 13, 2019
@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2019
@petrochenkov
Copy link
Contributor

cc @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

Historically I've looked at doing this but didn't see it as immediately actionable. Seems like pprust is still just as coupled with this commit. But I don't mind it, I guess, since it should make further decoupling easier (since you can handle each case separately, vs. an unknown number of cases through a Display/Debug impl).

@Centril
Copy link
Contributor Author

Centril commented Oct 13, 2019

(iirc there were rather few dependencies on pprust left in libsyntax after #65324 so in a larger context this should bring us closer to that goal.)

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

@bors r+

Changes look correct to me, and it seems to be passing CI. Some of the debug output is probably technically worse now but not in a way that seems immediately bad to me so we can probably leave it be for the time being.

@bors
Copy link
Contributor

bors commented Oct 13, 2019

📌 Commit ab8105e has been approved by Mark-Simulacrum

@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 Oct 13, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 14, 2019
Remove implicit dependencies on syntax::pprust

Part of rust-lang#65324.

The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer.

r? @estebank
Centril added a commit to Centril/rust that referenced this pull request Oct 14, 2019
Remove implicit dependencies on syntax::pprust

Part of rust-lang#65324.

The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer.

r? @estebank
bors added a commit that referenced this pull request Oct 14, 2019
Rollup of 7 pull requests

Successful merges:

 - #65215 (Add long error explanation for E0697)
 - #65292 (Print lifetimes with backticks)
 - #65362 (syntax: consolidate function parsing in item.rs)
 - #65363 (Remove implicit dependencies on syntax::pprust)
 - #65379 (refactor session::config::build_session_options_and_crate_config)
 - #65392 (Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering)
 - #65395 (Add some tests for fixed ICEs)

Failed merges:

r? @ghost
bors added a commit that referenced this pull request Oct 14, 2019
Rollup of 7 pull requests

Successful merges:

 - #65215 (Add long error explanation for E0697)
 - #65292 (Print lifetimes with backticks)
 - #65362 (syntax: consolidate function parsing in item.rs)
 - #65363 (Remove implicit dependencies on syntax::pprust)
 - #65379 (refactor session::config::build_session_options_and_crate_config)
 - #65392 (Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering)
 - #65395 (Add some tests for fixed ICEs)

Failed merges:

r? @ghost
@bors bors merged commit ab8105e into rust-lang:master Oct 14, 2019
@Centril Centril deleted the less-pprust branch October 14, 2019 14:09
calebcartwright added a commit to calebcartwright/rustfmt that referenced this pull request Jan 16, 2020
implicit pprust dependencies were removed and now require explicit usage
rust-lang/rust#65363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants