rust/src
bors 4e0d0d757e Auto merge of #102750 - the8472:opt-field-order, r=wesleywiser
optimize field ordering by grouping m*2^n-sized fields with equivalently aligned ones

```rust
use std::ptr::addr_of;
use std::mem;

struct Foo {
    word: u32,
    byte: u8,
    ary: [u8; 4]
}

fn main() {
    let foo: Foo = unsafe { mem::zeroed() };

    println!("base: {:p}\nword: {:p}\nbyte: {:p}\nary:  {:p}", &foo, addr_of!(foo.word), addr_of!(foo.byte), addr_of!(foo.ary));
}
```

prints

```
base: 0x7fffc1a8a668
word: 0x7fffc1a8a668
byte: 0x7fffc1a8a66c
ary:  0x7fffc1a8a66d
```

I.e. the `u8` in the middle causes the array to sit at an odd offset, which might prevent optimizations, especially on architectures where unaligned loads are costly.

Note that this will make field ordering niche-dependent, i.e. a `Bar<T>` with `T=char` and `T=u32` may result in different field order, this may break some code that makes invalid assumptions about `repr(Rust)` types.
2022-11-23 10:01:48 +00:00
..
bootstrap Bump fd-lock in bootstrap again 2022-11-23 00:12:57 +01:00
ci Rollup merge of #104622 - nicholasbishop:bishop-uefi-clang, r=Mark-Simulacrum 2022-11-22 01:26:08 -05:00
doc Add powerpc64-ibm-aix as Tier-3 target 2022-11-17 16:36:54 +08:00
etc [debuginfo] Make debuginfo type names for slices and str consistent. 2022-10-31 15:43:44 +01:00
librustdoc Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnr 2022-11-22 22:54:38 -05:00
llvm-project@a1232c451f update LLVM submodule to make libunwind work on SGX 2022-11-06 15:33:00 +01:00
rustdoc-json-types rustdoc JSON: Clarify that Function is also used for methods 2022-11-20 13:48:49 +01:00
test Auto merge of #102750 - the8472:opt-field-order, r=wesleywiser 2022-11-23 10:01:48 +00:00
tools Auto merge of #104758 - Manishearth:rollup-rh1tfum, r=Manishearth 2022-11-23 06:48:56 +00:00
README.md Remove miri from the submodule list and require it for CI to pass 2022-09-21 15:35:53 +00:00
stage0.json Bump to latest beta 2022-11-06 17:11:02 -05:00
version Bump to 1.67.0 2022-10-29 10:28:52 -04:00

This directory contains the source code of the rust project, including:

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

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