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

Change ty and const error's pretty printing to be in braces #111991

Merged
merged 1 commit into from
May 27, 2023

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented May 26, 2023

[const error] and [type error] are slightly confusing since they look like either a slice with an error type for the element ty or a slice with a const argument as the type ???. This PR changes them to display as {const error} and {type error} similar to {integer}.

This does not update the Debug impls for them which is done in #111988.

I updated some error logic to avoid printing the substs of trait refs when unable to resolve an assoc item for them, this avoids emitting errors with {type error} in them. The substs are not relevant for these errors since we don't take into account the substs when resolving the assoc item.

r? @compiler-errors

@BoxyUwU BoxyUwU marked this pull request as ready for review May 26, 2023 12:43
@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 May 26, 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.

r=me after nit, the general idea of changing the formatting seems fine to me

@BoxyUwU BoxyUwU force-pushed the change_error_term_display branch 2 times, most recently from f382cb1 to 35a2884 Compare May 26, 2023 14:11
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU BoxyUwU force-pushed the change_error_term_display branch from 35a2884 to ad77bc8 Compare May 26, 2023 15:01
@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 26, 2023

📌 Commit ad77bc8 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 May 26, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this pull request May 26, 2023
… r=compiler-errors

Change ty and const error's pretty printing to be in braces

`[const error]` and `[type error]` are slightly confusing since they look like either a slice with an error type for the element ty or a slice with a const argument as the type ???. This PR changes them to display as `{const error}` and `{type error}`  similar to `{integer}`.

This does not update the `Debug` impls for them which is done in rust-lang#111988.

I updated some error logic to avoid printing the substs of trait refs when unable to resolve an assoc item for them, this avoids emitting errors with `{type error}` in them. The substs are not relevant for these errors since we don't take into account the substs when resolving the assoc item.

r? `@compiler-errors`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#111714 (Stop confusing specification levels when computing expectations.)
 - rust-lang#111927 (Migrate `item_static` to Askama)
 - rust-lang#111954 (improve error message for calling a method on a raw pointer with an unknown pointee)
 - rust-lang#111973 (Update current implementation comments for `select_nth_unstable`)
 - rust-lang#111976 (Generate docs for bootstrap itself)
 - rust-lang#111977 (Make errors from `x doc` less verbose)
 - rust-lang#111987 (do not prefer substs relate during coherence)
 - rust-lang#111991 (Change ty and const error's pretty printing to be in braces)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a992097 into rust-lang:master May 27, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 27, 2023
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.

5 participants