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

Rid the AST & HIR pretty printer of cruft #119169

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

fmease
Copy link
Member

@fmease fmease commented Dec 20, 2023

Found while working on #119163.

For trait Trait: ?Sized {} (semantically malformed), we currently output trait Trait for ? Sized {} (sic!) / trait Trait for ? Sized { } (sic!) if -Zunpretty=expanded / -Zunpretty=hir is passed.

trait Tr for Sized? {} (#15521) and later also trait Tr for ?Sized {} (I guess, #20194) is former Rust syntax. Hence I'm removing these outdated branches.

This will conflict with #119163, therefore marking this PR as blocked. Rebased

@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2023

r? @compiler-errors

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 20, 2023
@fmease fmease added C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Dec 20, 2023
@@ -553,17 +553,7 @@ impl<'a> State<'a> {
}
hir::ItemKind::OpaqueTy(opaque_ty) => {
Copy link
Member Author

@fmease fmease Dec 20, 2023

Choose a reason for hiding this comment

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

Is this branch reachable in practice? 🤔 type T = impl B; gets printed as type T = /*impl Trait*/; since the item gets to interpreted as a normal type alias in this specific case with a RHS of hir::TyKind::OpaqueDef. Doesn't matter anyway.

@fmease fmease added the A-pretty Area: Pretty printing (including `-Z unpretty`) label Dec 20, 2023
@fmease fmease changed the title Rid the AST & HIR pretty printers of syntactic cruft Rid the AST & HIR pretty printers of cruft Dec 20, 2023
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

🆒 🆒

@compiler-errors
Copy link
Member

r=me

@fmease fmease changed the title Rid the AST & HIR pretty printers of cruft Rid the AST & HIR pretty printer of cruft Dec 20, 2023
@fmease fmease removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 21, 2023
@bors
Copy link
Contributor

bors commented Dec 22, 2023

☔ The latest upstream changes (presumably #119163) made this pull request unmergeable. Please resolve the merge conflicts.

@fmease fmease force-pushed the pretty-yeet-syntactic-cruft branch from 78ca460 to b09889b Compare December 22, 2023 13:33
@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Dec 22, 2023
@fmease
Copy link
Member Author

fmease commented Dec 22, 2023

@bors r=compiler-errors rollup

@bors
Copy link
Contributor

bors commented Dec 22, 2023

📌 Commit b09889b has been approved by compiler-errors

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 22, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 22, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#117601 (Add support for hexagon-unknown-none-elf as target)
 - rust-lang#119169 (Rid the AST & HIR pretty printer of cruft)
 - rust-lang#119194 (Run fuchsia tests only on nightly)
 - rust-lang#119201 (tests: fix overaligned-constant to not over-specify getelementptr instr)
 - rust-lang#119215 (Emits error if has bound regions)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 15dc9f5 into rust-lang:master Dec 22, 2023
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Dec 22, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 22, 2023
Rollup merge of rust-lang#119169 - fmease:pretty-yeet-syntactic-cruft, r=compiler-errors

Rid the AST & HIR pretty printer of cruft

Found while working on rust-lang#119163.

For `trait Trait: ?Sized {}` (semantically malformed), we currently output `trait Trait for ? Sized {}` (sic!) / `trait Trait for ? Sized { }` (sic!) if `-Zunpretty=expanded` / `-Zunpretty=hir` is passed.

`trait Tr for Sized? {}` (rust-lang#15521) and later also `trait Tr for ?Sized {}` (I guess, rust-lang#20194) is former Rust syntax. Hence I'm removing these outdated branches.

~~This will conflict with rust-lang#119163, therefore marking this PR as blocked.~~ Rebased
@fmease fmease deleted the pretty-yeet-syntactic-cruft branch December 22, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant 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.

4 participants