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

syntax: Don't parameterize the the pretty printer #12993

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

The pretty printer constitues an enormous amount of code, there's no reason for
it to be generic. This just least to a huge amount of metadata which isn't
necessary. Instead, this change migrates the pretty printer to using a trait
object instead.

Closes #12985

@eddyb
Copy link
Member

eddyb commented Mar 18, 2014

LGTM, I was hoping this wouldn't happen, but the fix is exactly what I had in mind, in case it went wrong.

The pretty printer constitues an enormous amount of code, there's no reason for
it to be generic. This just least to a huge amount of metadata which isn't
necessary. Instead, this change migrates the pretty printer to using a trait
object instead.

Closes rust-lang#12985
@bors bors closed this in 87e72c3 Mar 19, 2014
@alexcrichton alexcrichton deleted the maybe-fix-mac32 branch March 19, 2014 04:53
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 16, 2022
…, r=Veykril

Make `Name` hold escaped name

Resolves rust-lang#12787
Resolves rust-lang#99361

This PR effectively swaps `Name` and `EscapedName` in hir. In other words, it makes `Name` hold and print escaped raw identifiers and introduces another struct `UnescapedName` for cases where you need to print names without "r#" prefix.

My rationale is that it makes it easier for us to format an escaped name into string, which is what we want when we serialize names in general. This is because we format a name into string usually when we are presenting it to the users and arguably they expect its escaped form as that's what they see and write in the source code.

I split the change for `Name` into 3 commits to make it easier to follow but it also made some tests fail in the intermediate commits. I can squash them into a commit after the review if desired. I've also made similar changes for `ModPath` and `EscapedModPath` as it makes them consistent with `Name`.

For reference, there was a brief discussion on this in [a zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/escaping.20.60Name.60s).
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 24, 2024
…agraph, r=Centri3

Add new `too_long_first_doc_paragraph` first paragraph lint

Fixes rust-lang/rust-clippy#12989.

changelog: Add new `too_long_first_doc_paragraph` first paragraph lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mac-32 nopt builds are broken again
2 participants