Skip to content

make ty::Const debug printing less verbose - #115884

Merged
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:const-debug-print
Sep 16, 2023
Merged

make ty::Const debug printing less verbose#115884
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:const-debug-print

Conversation

@RalfJung

Copy link
Copy Markdown
Member

Similar in spirit to #115873

@rustbot

Copy link
Copy Markdown
Collaborator

r? @b-naber

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

@rustbotrustbot 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
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
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

@bors r+ rollup

r? @oli-obk

@bors

bors commented Sep 16, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 7e36514 has been approved by oli-obk

It is now in the queue for this repository.

@rustbotrustbot assigned oli-obk and unassigned b-naberSep 16, 2023
@borsbors 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
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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

bors commented Sep 16, 2023

Copy link
Copy Markdown
Collaborator

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

@borsbors 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
Copy Markdown
MemberAuthor

@bors r=oli-obk

@bors

bors commented Sep 16, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 5a3410a has been approved by oli-obk

It is now in the queue for this repository.

@borsbors 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:masterSep 16, 2023
@rustbotrustbot 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@RalfJung@rustbot@oli-obk@bors@nnethercote@b-naber