mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 09:32:42 +00:00
autodiff: Handle slice-tailed DSTs in type trees Fixes rust-lang/rust#160327 References to `OsStr` reach a `[u8]` tail, but autodiff only recognized direct slices. TypeTree generation then recursed into `OsStr` and hit the slice arm that ICEd. TypeTree generation and ABI activity handling now use `struct_tail_for_codegen`. Slice wrappers keep their element metadata, while prefixed DSTs retain their field offsets. IMO, reusing the existing rustc DST-tail query is cleaner than adding an `OsStr` special case. BTW, coverage includes the reduced `clap_lex` reproducer plus a prefixed slice-tail DST.
The codegen crate contains the code to convert from MIR into LLVM IR,
and then from LLVM IR into machine code. In general it contains code
that runs towards the end of the compilation process.
For more information about how codegen works, see the rustc dev guide.