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

Removed verbose printing from the PrettyPrinter when printing constants #103428

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

SarthakSingh31
Copy link
Contributor

Partially solves #94187 by completing the first step described in this comment.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 23, 2022
@rust-highfive
Copy link
Collaborator

r? @nagisa

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2022
@compiler-errors
Copy link
Member

I think this should instead be implemented using an opt-in macro like: https://doc.rust-lang.org/stable/nightly-rustc/rustc_middle/ty/print/macro.with_no_queries.html

And that can be used when rendering the type name for the library call -- I find Zverbose very useful when debugging rustc itself, and removing it unconditionally seems like the wrong approach in my opinion.

@rustbot
Copy link
Collaborator

rustbot commented Oct 25, 2022

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@SarthakSingh31
Copy link
Contributor Author

@compiler-errors Is this the correct way? I am super new to contributing to rust.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 25, 2022

r? @compiler-errors

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.

Yes, this looks correct.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 25, 2022

📌 Commit 5e46d86 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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 26, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#95710 (Stabilize arbitrary_enum_discriminant, take 2)
 - rust-lang#102706 (Support excluding the generation of the standalone docs)
 - rust-lang#103428 (Removed verbose printing from the `PrettyPrinter` when printing constants)
 - rust-lang#103543 (Update books)
 - rust-lang#103546 (interpret: a bit of cast cleanup)
 - rust-lang#103554 (rustdoc: add visible focus outline to rustdoc-toggle)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ffde0f7 into rust-lang:master Oct 26, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 26, 2022
@SarthakSingh31 SarthakSingh31 deleted the issue-94187 branch October 27, 2022 03:10
notriddle added a commit to notriddle/rust that referenced this pull request Oct 30, 2022
…mpiler-errors

All verbosity checks in `PrettyPrinter` now go through `PrettyPrinter::should_print_verbose`

Follow-up to rust-lang#103428. That pr only partially fixed rust-lang#94187. In some cases (like closures) `std::any::type_name` was still producing a different output when `-Zverbose` was enabled.

This pr fixes those cases and adds a new function `PrettyPrinter::should_print_verbose`. This function should always be used over `self.tcx().sess.verbose()` inside a `impl PrettyPrinter`.

Maybe closes rust-lang#94187 now.

r? `@compiler-errors`
notriddle added a commit to notriddle/rust that referenced this pull request Oct 31, 2022
…mpiler-errors

All verbosity checks in `PrettyPrinter` now go through `PrettyPrinter::should_print_verbose`

Follow-up to rust-lang#103428. That pr only partially fixed rust-lang#94187. In some cases (like closures) `std::any::type_name` was still producing a different output when `-Zverbose` was enabled.

This pr fixes those cases and adds a new function `PrettyPrinter::should_print_verbose`. This function should always be used over `self.tcx().sess.verbose()` inside a `impl PrettyPrinter`.

Maybe closes rust-lang#94187 now.

r? ``@compiler-errors``
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. 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.

7 participants