rust/compiler/rustc_middle
bors 9618da7c99 Auto merge of #131422 - GnomedDev:smallvec-predicate-obligations, r=compiler-errors
Use `ThinVec` for PredicateObligation storage

~~I noticed while profiling clippy on a project that a large amount of time is being spent allocating `Vec`s for `PredicateObligation`, and the `Vec`s are often quite small. This is an attempt to optimise this by using SmallVec to avoid heap allocations for these common small Vecs.~~

This PR turns all the `Vec<PredicateObligation>` into a single type alias while avoiding referring to `Vec` around it, then swaps the type over to `ThinVec<PredicateObligation>` and fixes the fallout. This also contains an implementation of `ThinVec::extract_if`, copied from `Vec::extract_if` and currently being upstreamed to https://github.com/Gankra/thin-vec/pull/66.

This leads to a small (0.2-0.7%) performance gain in the latest perf run.
2024-10-16 04:06:14 +00:00
..
src Auto merge of #131422 - GnomedDev:smallvec-predicate-obligations, r=compiler-errors 2024-10-16 04:06:14 +00:00
Cargo.toml compiler: Factor rustc_target::abi::* out of middle::ty::layout 2024-10-08 18:14:48 -07:00
messages.ftl TL note: current means target 2024-09-20 10:02:14 -07:00
README.md

For more information about how rustc works, see the rustc dev guide.