Uh oh!
There was an error while loading. Please reload this page.
add #[rustc_layout(debug)] - #69901
Conversation
rust-highfive
commented
Mar 10, 2020
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
jonas-schievink
commented
Mar 10, 2020
Cool! This will be helpful for testing generator layout optimizations in the future. |
RalfJung
commented
Mar 10, 2020
I figured it would be useful for tons of stuff. :) We have to think of some ways to make sure that the right people even know about it... like finding a good place in the rustc dev guide to mention it. I also plan to write a blog post. |
Uh oh!
There was an error while loading. Please reload this page.
eddyb
commented
Mar 10, 2020
cc @rust-lang/compiler |
cramertj
commented
Mar 10, 2020
r? @eddyb |
RalfJung
commented
Mar 20, 2020
@eddyb I made this work on type definitions, not just type aliases. |
eddyb
commented
Mar 20, 2020
@bors r+ Thanks! |
bors
commented
Mar 20, 2020
📌 Commit c62e36b has been approved by |
This comment has been minimized.
This comment has been minimized.
eddyb
commented
Mar 20, 2020
@bors r- (failed because formatting) |
RalfJung
commented
Mar 20, 2020
Fixed that. @bors r=eddyb |
bors
commented
Mar 20, 2020
📌 Commit 7b49678 has been approved by |
add #[rustc_layout(debug)] @eddyb recently told me about the `#[rustc_layout]` attribute, and I think it would be very useful if it could be used to print all the layout information Rust has about a type. When working with layouts (e.g. in Miri), it is often not clear how certain surface language features get represented internally. I have some awful hacks locally to be able to dump this debug information; with this attribute I could get it on the playground which is so much better. :)
add #[rustc_layout(debug)] @eddyb recently told me about the `#[rustc_layout]` attribute, and I think it would be very useful if it could be used to print all the layout information Rust has about a type. When working with layouts (e.g. in Miri), it is often not clear how certain surface language features get represented internally. I have some awful hacks locally to be able to dump this debug information; with this attribute I could get it on the playground which is so much better. :)
Centril
commented
Mar 21, 2020
Failed in #70203 (comment), @bors r- |
RalfJung
commented
Mar 21, 2020
Looks like "preferred alignment" differs for some platforms: @eddyb should I just normalize all |
eddyb
commented
Mar 21, 2020
@RalfJung Does this work? |
RalfJung
commented
Mar 21, 2020
Yes that works, nice. @bors r=eddyb |
bors
commented
Mar 21, 2020
📌 Commit e548df7 has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#69497 (Don't unwind when hitting the macro expansion recursion limit) - rust-lang#69901 (add #[rustc_layout(debug)]) - rust-lang#69910 (Avoid query type in generics) - rust-lang#69955 (Fix abort-on-eprintln during process shutdown) - rust-lang#70032 (put type params in front of const params in generics_of) - rust-lang#70119 (rustc: use LocalDefId instead of DefId in TypeckTables.) Failed merges: r? @ghost
elichai
commented
Apr 6, 2020
That's awesome! |
@eddyb recently told me about the
#[rustc_layout]attribute, and I think it would be very useful if it could be used to print all the layout information Rust has about a type. When working with layouts (e.g. in Miri), it is often not clear how certain surface language features get represented internally. I have some awful hacks locally to be able to dump this debug information; with this attribute I could get it on the playground which is so much better. :)