rust/src
bors f2e1a3a80a Auto merge of #125360 - RalfJung:packed-field-reorder, r=fmease
don't inhibit random field reordering on repr(packed(1))

`inhibit_struct_field_reordering_opt` being false means we exclude this type from random field shuffling. However, `packed(1)` types can still be shuffled! The logic was added in https://github.com/rust-lang/rust/pull/48528 since it's pointless to reorder fields in packed(1) types (there's no padding that could be saved) -- but that shouldn't inhibit `-Zrandomize-layout` (which did not exist at the time).

We could add an optimization elsewhere to not bother sorting the fields for `repr(packed)` types, but I don't think that's worth the effort.

This *does* change the behavior in that we may now reorder fields of `packed(1)` structs (e.g. if there are niches, we'll try to move them to the start/end, according to `NicheBias`).  We were always allowed to do that but so far we didn't. Quoting the [reference](https://doc.rust-lang.org/reference/type-layout.html):

> On their own, align and packed do not provide guarantees about the order of fields in the layout of a struct or the layout of an enum variant, although they may be combined with representations (such as C) which do provide such guarantees.
2024-05-29 11:57:13 +00:00
..
bootstrap Rollup merge of #125639 - ChrisDenton:run-make-support-doc, r=onur-ozkan 2024-05-29 03:25:10 +01:00
ci Rollup merge of #125590 - ChrisDenton:mingw-ci-3, r=Kobzol 2024-05-28 18:04:32 +02:00
doc Rollup merge of #124320 - Urgau:print-check-cfg, r=petrochenkov 2024-05-29 03:25:07 +01:00
etc lldb-formatters: Use StdSliceSyntheticProvider for &str 2024-05-11 12:11:55 -07:00
librustdoc Auto merge of #125599 - camelid:clarify-stability, r=notriddle,GuillaumeGomez 2024-05-27 18:42:42 +00:00
llvm-project@b31c30a9bb Update to LLVM 18.1.6 2024-05-19 18:24:30 +02:00
rustdoc-json-types Rollup merge of #125130 - aDotInTheVoid:id-docs, r=GuillaumeGomez 2024-05-16 16:22:45 +02:00
tools Auto merge of #125360 - RalfJung:packed-field-reorder, r=fmease 2024-05-29 11:57:13 +00:00
README.md Remove stale reference to the test suite location 2023-01-13 11:49:06 +00:00
stage0 Bump bootstrap compiler to the latest beta compiler 2024-05-24 08:07:39 +02:00
version Bump version to 1.80 2024-04-27 19:03:50 -04:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.