about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-21 14:11:13 +0100
committerGitHub <noreply@github.com>2022-11-21 14:11:13 +0100
commit439a8e6cef1aac30a65a36d7c4ac0bb701d11fa7 (patch)
tree6cefea8d2b7f23722da99067e31f767654400cd0 /compiler/rustc_codegen_llvm/src
parent5b9289215e0afb73efbf882e8d6f0af461fc99f2 (diff)
parenta6e09a19fc20cdf9043e1b856d15170ac0f96511 (diff)
downloadrust-439a8e6cef1aac30a65a36d7c4ac0bb701d11fa7.tar.gz
rust-439a8e6cef1aac30a65a36d7c4ac0bb701d11fa7.zip
Rollup merge of #104662 - nnethercote:tweak-deriving-for-packed-non-copy, r=jackh726
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.

r? ``@jackh726``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions