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

Refiled: "Rustfmt/pretty-print types in error messages" #54923

Open
Centril opened this issue Oct 9, 2018 · 0 comments
Open

Refiled: "Rustfmt/pretty-print types in error messages" #54923

Centril opened this issue Oct 9, 2018 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one. D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics

Comments

@Centril
Copy link
Contributor

Centril commented Oct 9, 2018

Refiling...

For any highly generic library (futures is the one that I hit this issue with a lot) it's easy for types to become unreadable very fast. Even impl Trait only helps so much (we're using Box<Trait> a lot in our code so impl Trait won't get us better error messages). A good solution would be to rustfmt-style pretty-print types in the error messages so that it's possible for humans to parse them. It might be useful to make this optional or otherwise limit the maximum size because I can imagine this causing diesel's types to take hundreds of lines to print. Probably some kind of overrideable heuristic would be useful to implement here.

rust-lang/rfcs#2358

@Centril Centril added A-frontend Area: Compiler frontend (errors, parsing and HIR) A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics labels Oct 9, 2018
@crlf0710 crlf0710 added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jun 11, 2020
@jieyouxu jieyouxu added the D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one. D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics
Projects
None yet
Development

No branches or pull requests

3 participants