Unnamed repository; edit this file 'description' to name the repository.
Rollup merge of #148281 - RalfJung:repr-transparent-check, r=nnethercote
repr(transparent) check: do not compute check_unsuited more than once `field_infos` is an iterator that we execute multiple times. However, we usually ignore the `unsuited` field -- we only need it in the last iteration. So move the computation of that field to that iteration to avoid computing it multiple times. Computing `unsuited` involves a recursive traversal over the types of all non-trivial fields, so there can be non-trivial amounts of work here. (I benchmarked this in https://github.com/rust-lang/rust/pull/148243 and saw no changes, probably because we don't have a benchmark with many repr(transparent) types. But still, computing this each time just seemed silly.)
Matthias Krüger 5 months ago
parent 8910e5d · parent 60b0c9c · commit 6d8e723
0 files changed, 0 insertions, 0 deletions