rust/compiler/rustc_codegen_ssa/src
bors 9556d7a09a Auto merge of #88337 - eddyb:field-failure-is-not-an-option, r=nagisa
rustc_target: `TyAndLayout::field` should never error.

This refactor (making `TyAndLayout::field` return `TyAndLayout` without any `Result` around it) is based on a simple observation, regarding `TyAndLayout::field`:

If `cx.layout_of(ty)` succeeds (for some `cx` and `ty`), then `.field(cx, i)` on the resulting `TyAndLayout` should *always* succeed in computing `cx.layout_of(field_ty)` (where `field_ty` is the type of the `i`th field of `ty`).

The reason for this is that no matter which field is chosen, `cx.layout_of(field_ty)` *will have already been computed*, as part of computing `cx.layout_of(ty)`, as we cannot determine the layout of *any* type without considering the layouts of *all* of its fields.

And so it should be fine to turn any errors into ICEs, since they likely indicate a `cx` mismatch, or some other edge case that is due to a compiler bug (as opposed to ever being an user-facing error).

<hr/>

Each commit should probably be reviewed separately, though note that there's some `where` clauses (in `rustc_target::abi::call::*`) that change in most commits.

cc `@nagisa` `@oli-obk`
2021-08-29 22:54:26 +00:00
..
back Auto merge of #88250 - rusticstuff:macos-lld, r=nagisa 2021-08-29 04:51:14 +00:00
coverageinfo Reland - Report coverage 0 of dead blocks 2021-06-01 13:28:59 -07:00
debuginfo Use custom wrap-around type instead of Range 2021-08-22 21:46:03 +02:00
mir rustc_target: TyAndLayout::field should never error. 2021-08-30 00:44:09 +03:00
traits rustc_target: add lifetime parameter to LayoutOf. 2021-08-27 13:09:32 +03:00
base.rs Fold vtable_trait_upcasting_coercion_new_vptr_slot logic into obligation processing. 2021-08-18 13:00:27 +08:00
common.rs Remove support for floating-point constants in asm! 2021-05-14 14:58:21 +01:00
glue.rs Refactor to make interpreter and codegen backend neutral to vtable internal representation. 2021-06-15 01:59:00 +08:00
lib.rs Fold LinkerInfo into CrateInfo 2021-07-06 18:28:07 +02:00
meth.rs Prepare inbounds_gep for opaque pointers 2021-08-04 15:51:30 +02:00
mono_item.rs Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
target_features.rs Remove crypto composite feature from allowed aarch64 features. 2021-08-03 12:07:56 +00:00