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

make ty::Const debug printing less verbose #115884

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

RalfJung
Copy link
Member

Similar in spirit to #115873

@rustbot
Copy link
Collaborator

rustbot commented Sep 16, 2023

r? @b-naber

(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 Sep 16, 2023
@@ -22,7 +22,7 @@
|
fn main() -> () {
let mut _0: ();
let mut _1: [usize; Const { ty: usize, kind: Leaf(0x00000003) }];
let mut _1: [usize; ValTree(Leaf(0x00000003): usize)];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test seems to enable "always verbose" mode, that's why it doesn't get 3_usize.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 16, 2023

@bors r+ rollup

r? @oli-obk

@bors
Copy link
Contributor

bors commented Sep 16, 2023

📌 Commit 7e36514 has been approved by oli-obk

It is now in the queue for this repository.

@rustbot rustbot assigned oli-obk and unassigned b-naber Sep 16, 2023
@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 Sep 16, 2023
if let ConstKind::Value(_) = this.data.kind() {
return ty::tls::with(move |tcx| {
// Somehow trying to lift the valtree results in lifetime errors, so we lift the
// entire constant.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out the Valtree Lift impl is bogus.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: #115831 is (coincidentally) about to remove a bunch of unused Lift impls, including the bogus one for Valtree. This shouldn't cause you problems given that you'll need to adjust the implementation, but I'm mentioning it just so it doesn't catch you unawares.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah not having it seems better than having a broken one. :) But it does mean the comment here will be outdated. I can't update it any more since the PR was already rolled up.

I do wonder what that means for performance (lifting the entire constant with the valtree -- valtrees are not interned so equality is probably expensive). Maybe valtree child lists should be interned to make this easier and faster?

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2023
…iaskrgr

Rollup of 2 pull requests

Successful merges:

 - rust-lang#115607 (clarify that unsafe code must not rely on our safe traits)
 - rust-lang#115866 (make interpreter and TyAndLayout type Debug impl independent of Ty debug impl)

Failed merges:

 - rust-lang#115873 (Make `TyKind::Adt`'s `Debug` impl be more pretty)
 - rust-lang#115884 (make ty::Const debug printing less verbose)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Sep 16, 2023

☔ The latest upstream changes (presumably #115889) made this pull request unmergeable. Please resolve the merge conflicts.

@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 Sep 16, 2023
@RalfJung
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Sep 16, 2023

📌 Commit 5a3410a has been approved by oli-obk

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 Sep 16, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2023
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#115860 (Enable varargs support for AAPCS calling convention)
 - rust-lang#115867 (coverage: Simplify internal representation of debug types)
 - rust-lang#115885 (don't globally ignore rustc-ice files)

Failed merges:

 - rust-lang#115873 (Make `TyKind::Adt`'s `Debug` impl be more pretty)
 - rust-lang#115884 (make ty::Const debug printing less verbose)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#115247 (Document std limitations before/after main)
 - rust-lang#115329 (fix std::primitive doc: homogenous -> homogeneous)
 - rust-lang#115487 (Improve documentation on when signes are printed by default)
 - rust-lang#115560 (Update doc for `alloc::format!` and `core::concat!`)
 - rust-lang#115836 (update rust_analyzer_settings.json)
 - rust-lang#115884 (make ty::Const debug printing less verbose)
 - rust-lang#115890 (Migrate GUI colors test to original CSS color format)
 - rust-lang#115895 (Improve Vec(Deque)::truncate documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit abae2b6 into rust-lang:master Sep 16, 2023
11 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 16, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2023
Rollup merge of rust-lang#115884 - RalfJung:const-debug-print, r=oli-obk

make ty::Const debug printing less verbose

Similar in spirit to rust-lang#115873
@RalfJung RalfJung deleted the const-debug-print branch September 19, 2023 08:05
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.

6 participants