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

dont randomly use _ to print out const generic arguments #106873

Merged
merged 4 commits into from
Jan 18, 2023

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Jan 14, 2023

const generics seem to get printed out as _ for no reason a lot of the time, as someone who spends a lot of time with const generics this has gotten ✨ very annoying ✨. Latest example would be #106423 where the ICE messaged formatted a ty::Const containing no infer vars, as _.

For some reason printing of the const argument on arrays was custom instead of using the existing logic for printing ty::Const. Additionally the existing logic for printing ty::Const would print out _ for anon consts that are in a separate crate leading to weird diagnostics (see second commit). There ought to be less cases of consts randomly getting printed as _ hiding valuable info now.

@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@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 Jan 14, 2023
@BoxyUwU BoxyUwU added A-diagnostics Area: Messages for errors, warnings, and lints A-const-generics Area: const generics (parameters and arguments) labels Jan 14, 2023
@BoxyUwU BoxyUwU force-pushed the ty_const_formatting branch from b6883ae to b683112 Compare January 14, 2023 19:58
@compiler-errors
Copy link
Member

r? @compiler-errors

@rustbot rustbot assigned compiler-errors and unassigned davidtwco Jan 14, 2023
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Jan 18, 2023

@bors r=me,compiler-errors

@bors
Copy link
Contributor

bors commented Jan 18, 2023

📌 Commit 30ec367e0c0dc09c37531edae5000388d13221c1 has been approved by me,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 Jan 18, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

compiler-errors commented Jan 18, 2023

@bors r- needs mir-opt bless

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 18, 2023
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Jan 18, 2023

i'm straight up not having a good time

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Jan 18, 2023

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Jan 18, 2023

📌 Commit 00c74aafacb94141741b26f0acc0d18ab869d6b7 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 18, 2023
@BoxyUwU BoxyUwU force-pushed the ty_const_formatting branch 2 times, most recently from 896a9ce to 733ed39 Compare January 18, 2023 04:15
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Jan 18, 2023

@bors r=me,compiler-errors

@bors
Copy link
Contributor

bors commented Jan 18, 2023

📌 Commit 733ed3905cb42be5bfb595c252eb05fc0915dd27 has been approved by me,compiler-errors

It is now in the queue for this repository.

@BoxyUwU BoxyUwU force-pushed the ty_const_formatting branch from 733ed39 to 91920d8 Compare January 18, 2023 04:42
@BoxyUwU BoxyUwU force-pushed the ty_const_formatting branch from 91920d8 to 1171fe5 Compare January 18, 2023 04:45
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Jan 18, 2023

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Jan 18, 2023

📌 Commit 1171fe5 has been approved by compiler-errors

It is now in the queue for this repository.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 18, 2023
…piler-errors

dont randomly use `_` to print out const generic arguments

const generics seem to get printed out as `_` for no reason a lot of the time, as someone who spends a lot of time with const generics this has gotten ✨ very annoying ✨. Latest example would be rust-lang#106423 where the ICE messaged formatted a `ty::Const` containing no infer vars, as `_`.

For some reason printing of the const argument on arrays was custom instead of using the existing logic for printing `ty::Const`. Additionally the existing logic for printing `ty::Const` would print out `_` for anon consts that are in a separate crate leading to weird diagnostics (see second commit). There ought to be less cases of consts randomly getting printed as `_` hiding valuable info now.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#106244 (Improve Markdown styling in README)
 - rust-lang#106747 (Add 'static lifetime suggestion when GAT implied 'static requirement from HRTB)
 - rust-lang#106873 (dont randomly use `_` to print out const generic arguments)
 - rust-lang#106992 (Remove unused `#![feature(box_syntax)]` in `alloc`)
 - rust-lang#106995 (bump failing assembly & codegen tests from LLVM 14 to LLVM 15)
 - rust-lang#106996 (rustdoc: instead of `.setting-name { width: 100% }`, use default div CSS)
 - rust-lang#106997 (Add heapsort fallback in `select_nth_unstable`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9e46c24 into rust-lang:master Jan 18, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) A-diagnostics Area: Messages for errors, warnings, and lints 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.

6 participants