summary refs log tree commit diff
path: root/compiler/rustc_abi/src/layout.rs
AgeCommit message (Collapse)AuthorLines
2023-04-04Use `FieldIdx` in `FieldsShape`Scott McMurray-40/+35
Finally got to the main motivating example from the MCP :)
2023-04-02Use `&IndexSlice` instead of `&IndexVec` where possibleScott McMurray-2/+2
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
2023-03-25Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`Scott McMurray-9/+9
Since structs are always `VariantIdx(0)`, there's a bunch of files where the only reason they had `VariantIdx` or `vec::Idx` imported at all was to get the first variant. So this uses a constant for that, and adds some doc-comments to `VariantIdx` while I'm there, since it doesn't have any today.
2023-01-21Remove some superfluous type parameters from layout.rs.Michael Benfield-75/+71
Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
2022-12-01Remove useless borrows and derefsMaybe Waffle-5/+5
2022-11-25Simplify and document range layout computationOli Scherer-13/+11
2022-11-24move things from rustc_target::abi to rustc_abihkalbasi-0/+947