about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-11-21 11:48:25 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-11-21 14:07:39 +1100
commita6e09a19fc20cdf9043e1b856d15170ac0f96511 (patch)
tree14e738619da822f4b4958d4fa3ba88b406d01cdb /compiler/rustc_codegen_llvm/src
parenta28f3c88e50a77bc2a91889241248c4543854e61 (diff)
downloadrust-a6e09a19fc20cdf9043e1b856d15170ac0f96511.tar.gz
rust-a6e09a19fc20cdf9043e1b856d15170ac0f96511.zip
Streamline deriving on packed structs.
The current approach to field accesses in derived code:
- Normal case: `&self.0`
- In a packed struct that derives `Copy`: `&{self.0}`
- In a packed struct that doesn't derive `Copy`: `let Self(ref x) = *self`

The `let` pattern used in the third case is equivalent to the simpler
field access in the first case. This commit changes the third case to
use a field access.

The commit also combines two boolean arguments (`is_packed` and
`always_copy`) into a single field (`copy_fields`) earlier, to save
passing both around.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions