diff options
author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-11-21 14:11:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 14:11:13 +0100 |
commit | 439a8e6cef1aac30a65a36d7c4ac0bb701d11fa7 (patch) | |
tree | 6cefea8d2b7f23722da99067e31f767654400cd0 /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs | |
parent | 5b9289215e0afb73efbf882e8d6f0af461fc99f2 (diff) | |
parent | a6e09a19fc20cdf9043e1b856d15170ac0f96511 (diff) | |
download | rust-439a8e6cef1aac30a65a36d7c4ac0bb701d11fa7.tar.gz |
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 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs')
0 files changed, 0 insertions, 0 deletions