Commit 6d8e723
authored
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 rust-lang/rust#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.)File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments