]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Auto merge of #69257 - RalfJung:layout-visitor, r=eddyb
authorbors <bors@rust-lang.org>
Mon, 2 Mar 2020 09:37:35 +0000 (09:37 +0000)
committerbors <bors@rust-lang.org>
Mon, 2 Mar 2020 09:37:35 +0000 (09:37 +0000)
commitc839a7b4c26e58319b0c40448dd423facff34cd0
tree38c78515839f1574b67c84038dc8241d40a6b7a0
parent6af4fd385ec23145bc3ba08f700c61361ae961c0
parent12054dce9ac82ec63aedb91082e3ea9cdc8c2e5c
Auto merge of #69257 - RalfJung:layout-visitor, r=eddyb

Adjust Miri value visitor, and doc-comment layout components

I realized that I still didn't have quite the right intuition for how our `LayoutDetails` work, so I had to adjust the Miri value visitor to the things I understood better now. I also added some doc-comments to `LayoutDetails` as a hopefully canonical place to note such things.

The main visitor change is that we *first* look at all the fields (according to `FieldPlacement`), and *then* check the variants and handle `Multiple` appropriately. I did not quite realize how orthogonal "fields" and "variants" are.
I also moved the check for the scalar ABI to *after* checking all the fields; this leads to better (more type-driven) error messages.

And it looks like we can finally remove that magic hack for `ty::Generator`. :D

r? @oli-obk for the Miri/visitor changes and @eddyb for the layout docs
The Miri PR is at: https://github.com/rust-lang/miri/pull/1178
src/librustc_mir/interpret/intern.rs
src/librustc_target/abi/mod.rs