rust/compiler/rustc_builtin_macros
Nicholas Nethercote a6e09a19fc 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.
2022-11-21 14:07:39 +11:00
..
src Streamline deriving on packed structs. 2022-11-21 14:07:39 +11:00
Cargo.toml rustdoc: use ThinVec for cleaned generics 2022-11-02 16:17:22 -07:00