-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
type_name
depends on -Zverbose
flag
#94187
Comments
Cc @rust-lang/wg-const-eval strange type-level equality quirk? |
rust/compiler/rustc_middle/src/ty/print/pretty.rs Lines 1152 to 1162 in c1aa854
|
That's not really a const eval issue. This likely also happens for any lifetimes or impl trait types or anything else affected by the verbose flag. Not sure we want to fix this, relying on a specific name is not something that should be done afaik. You should only use type names for printing to users |
|
jup, should fix that 😅 type_name should always not be verbose i think |
As a first step we should probably just remove the verbose flag check from rendering constants. That looks just useless even for compiler debugging. But to fix this properly we'll likely need to create a way to tell the pretty printer whether to use verbose mode or not, and entirely avoid using verbosity checks within it. |
…iler-errors Removed verbose printing from the `PrettyPrinter` when printing constants Partially solves rust-lang#94187 by completing the first step described in [this comment](rust-lang#94187 (comment)).
…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`
cc #63084
The text was updated successfully, but these errors were encountered: