-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
@@ -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)]; |
There was a problem hiding this comment.
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
.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
…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
☔ The latest upstream changes (presumably #115889) made this pull request unmergeable. Please resolve the merge conflicts. |
7e36514
to
5a3410a
Compare
@bors r=oli-obk |
…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
…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
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
Similar in spirit to #115873